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
 General SQL Server Forums
 New to SQL Server Programming
 INSERT function - HELP

Author  Topic 

vetsper
Starting Member

1 Post

Posted - 2010-09-28 : 08:49:54
how can I insert a value between '' quotes, but the value contain ' or , chars?

thanks.

harsh_athalye
Master Smack Fu Yak Hacker

5581 Posts

Posted - 2010-09-28 : 09:09:00
Replace any single quote character with two single quote characters. For example

'what's the fuss?'

can be written like


insert into tbl(col1)
values('what''s the fuss?')


Harsh Athalye
http://www.letsgeek.net/
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-09-30 : 12:28:23
see

http://beyondrelational.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -