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.
Author |
Topic |
jar21
51 Posts |
Posted - 2010-09-21 : 07:55:34
|
I have data I am trying to import via script however in the data itself there are single quotes, which is being interpreted as another input field (forgive me if my language is absolutely incorrect here) so there is a syntax error however I want the single quote to be there. is there a way to use single quotes without it being interpreted as one which is creating a syntax error?for example if I have 455 mc'lane way I want the quote to be there but not interpreted as part of the sql statement, sortof like text only. |
|
Sachin.Nand
2937 Posts |
Posted - 2010-09-21 : 08:15:18
|
You can escape single quote using two single quotes.Something like thisdeclare @tbl as table(nm varchar(20))insert into @tblselect '455 mc''lane'select * from @tbl PBUH |
 |
|
senthil_nagore
Master Smack Fu Yak Hacker
1007 Posts |
|
jar21
51 Posts |
Posted - 2010-09-21 : 08:55:11
|
Thanks for the answer and noob guide :-) |
 |
|
|
|
|