Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Insert Html in to table

Author  Topic 

atr232000
Starting Member

2 Posts

Posted - 2010-08-01 : 11:50:29
Hi

I have been writing a auto emial program for our marketing department so they can send out HTML coded email.

I have the system working as it accepts the htlm code and send the mail out (This is without writing lines to a DB)this was a testing function

However I also want to att the info into a DB.
However it clearly does not like having html code inserted into a column.

insert into EmailMess ([EmailFrom],[EmailTo],[EmailSubject],[EmailBody]) values('from@me.com','to@you.com','Test Subject','HTML CODE HERE');"

I have seen a few comments around but nothing that helps realy.

Any help would be great.

Thanks

webfred
Master Smack Fu Yak Hacker

8781 Posts

Posted - 2010-08-01 : 13:43:31
What is the problem?
Do you get an error message?
What datatype are you using?


No, you're never too old to Yak'n'Roll if you're too young to die.
Go to Top of Page

atr232000
Starting Member

2 Posts

Posted - 2010-08-01 : 16:04:46
Hi,
thanks for your reply

in my application I have a multi line textbox and I am pasting my HTML code in to it

then on a button click it does he insert command

I get a error reported from this "invalid syntax near ;b"
I read somewhere about wrapping the HTML code in something like <text> </text>
or encrypting the HTML code then inserting and selecting and decrypting

like I said above the code is fine as it works when it's not inserted in to a db

any help would be great

thanks
Go to Top of Page

yosiasz
Master Smack Fu Yak Hacker

1635 Posts

Posted - 2010-08-02 : 16:44:29
can you please post sample html or a piece of it especially the part that is giving you problem ;b

If you don't have the passion to help people, you have no passion
Go to Top of Page
   

- Advertisement -