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 |
|
mavershang
Posting Yak Master
111 Posts |
Posted - 2009-05-20 : 15:20:13
|
| Hi all. Here is my rookie question:SET @SQL=' SELECT '' AS T FROM table;'EXEC (@SQL)Now the question is how could I use that '' inside a ''. Thanks |
|
|
robvolk
Most Valuable Yak
15732 Posts |
Posted - 2009-05-20 : 15:29:51
|
| [code]SET @SQL='SELECT '''' AS TFROM table;'EXEC (@SQL)[/code]Simply double the apostrophes when embedded in a string value. |
 |
|
|
mavershang
Posting Yak Master
111 Posts |
Posted - 2009-05-20 : 15:43:08
|
Thanks a lotquote: Originally posted by robvolk
SET @SQL='SELECT '''' AS TFROM table;'EXEC (@SQL) Simply double the apostrophes when embedded in a string value.
|
 |
|
|
|
|
|