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 |
doco
Yak Posting Veteran
77 Posts |
Posted - 2012-09-06 : 12:33:16
|
I wish to have output from a query to have ' output '. How is this done?SELECT ' + parcel_number + ' produces 'parcel_number' instead of the parcel_number enclosed in single quotes.TIAEducation is what you have after you've forgotten everything you learned in school |
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2012-09-06 : 12:38:51
|
select '''' + parcel_number + ''''inside single quote, if you want to have another single quote then you can escape that with another single quote.so you have 4 single quotes to get 1 single quote in the output. Too old to Rock'n'Roll too young to die. |
|
|
doco
Yak Posting Veteran
77 Posts |
Posted - 2012-09-06 : 13:01:01
|
Ah, yes! Guess I didn't go far enough. I tried ''' which is more intrinsic than ''''. Anyway thanks!Education is what you have after you've forgotten everything you learned in school |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|