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 |
|
jeff06
Posting Yak Master
166 Posts |
Posted - 2007-11-07 : 10:57:45
|
| #t1:namejeffbobselect txt='insert into #b values (' +name +')'from #t1this code generate:insert into #b values (jeff)insert into #b values (bob)but I want getinsert into #b values ('jeff')insert into #b values ('bob')How can I show the real "'" in the resulting string ?Thanks |
|
|
harsh_athalye
Master Smack Fu Yak Hacker
5581 Posts |
Posted - 2007-11-07 : 11:00:29
|
| [code]select txt='insert into #b values ('''+name +''')'from #t1[/code]Harsh AthalyeIndia."The IMPOSSIBLE is often UNTRIED" |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-11-07 : 12:18:51
|
orselect txt='insert into #b values ('+ char(39)+ name + char(39)+ ')'from #t1if you prefer thatKristen |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
Kristen
Test
22859 Posts |
Posted - 2007-11-07 : 12:35:51
|
Yeah, but its making a script that the OP can put on a CD and take to their server on Mars ... |
 |
|
|
jeff06
Posting Yak Master
166 Posts |
Posted - 2007-11-07 : 14:09:22
|
| Thanks, Guys. |
 |
|
|
|
|
|