November 15, 2005 at 1:58 am
My problem:
I need create result with special characters example:
in table is Peter
I need in result
'Peter'
Thanx
M.
November 15, 2005 at 3:38 am
If the table is called bar and the column where Peter is stored is called foo, then this would give the result you want:
SELECT '' + foo + '' AS foo
FROM bar
November 18, 2005 at 2:57 am
Also if you know the ASCII code of your special character then you can insert it like this example is inserting a carriage return (ASCII code 13) between Column1 and Column2 concatenated a a single string
select Column1+ char(13) + Column2 from MyTable
And a a correction to Chris's example he is missing some quotes
The correct answer is:
SELECT '''' + foo + '''' AS foo
FROM bar
Bye
Gabor
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply