|
I need to wrap the result of a sql statement in single quotes so that is can be passed as a string later in the sproc.... Each value in the comma separated list - so this result below will reveal 1345 ,5427 ,3166 ,8367 ,7370
(comments are locked)
|
|
If you just need a quote on either end then try this: or this: or use the quotename specifying a single quote as the character to use: Oleg You can use RTRIM between the two char(39) to remove the space before the final single quote, if your sample result with no space was the absolute requirement. Building and passing delimited strings around TSQL looks like you could be building something rather complex and dynamic. You might take another look at your overall approach to see if you can do it a little more straight-up TSQL. You could potentially avoid a performance and troubleshooting quagmire.
May 11 '11 at 10:33 AM
KenJ
(comments are locked)
|

