I inserted an html into a table using sql server

1

How could an insert into a table an HTML code?

Example:

insert into TB_CONTEUDO (CONT_TITULO, CONT_HTML, CONT_COCA_FK_ID, CONT_META_TAG)
values('Teste','',17,'')

CONT_HTML = html of a page

    
asked by anonymous 02.06.2017 / 21:46

1 answer

0

In the same way that you wrote here, you will save this field as you were saving a String normally, the only concern you should have is to check if your HTML content > does not exceed the character limit of your field .

A great type to save your HTML content in SQL Server, would be NVARCHAR(MAX)

insert into TB_CONTEUDO (CONT_TITULO, CONT_HTML, CONT_COCA_FK_ID, CONT_META_TAG)
values('Teste','<html><body>seu conteúdo html</body></html>',17,'')
    
02.06.2017 / 21:51