Hello,
I would like to create more lines by concatenating values.
When I use: <select 'This' + ' ' + 'is' + ' ' + 'an' + ' ' + 'example'> the
result is <This is an example> (on the same line).
I woul like to get:
<This
is
an
example> (each 'word' on a new line, but in 1 field)
Whis SQL statement do i have to use?SELECT 'This' + ' ' + CHAR(10) + 'is' + CHAR(10) + ' ' + 'an' + CHAR(10) + '
' + 'example'
Dejan Sarka, SQL Server MVP
Associate Mentor
Solid Quality Learning
More than just Training
www.SolidQualityLearning.com
"Hans de Korte" <hans.de.korte@.prominent.nl> wrote in message
news:06D0883E-6C6A-48F5-8205-58FA1B716BDF@.microsoft.com...
> Hello,
> I would like to create more lines by concatenating values.
> When I use: <select 'This' + ' ' + 'is' + ' ' + 'an' + ' ' + 'example'>
the result is <This is an example> (on the same line).
> I woul like to get:
> <This
> is
> an
> example> (each 'word' on a new line, but in 1 field)
> Whis SQL statement do i have to use?|||You can use carriage return (CHAR(13)) and line feed (CHAR(10)) separators:
DECLARE @.CrLF AS char(2)
SET @.CrLF = CHAR(13) + CHAR(13)
SELECT 'This' + @.CrLF +
'is' + @.CrLF +
'an' + @.CrLF +
'example'
Hope this helps.
Dan Guzman
SQL Server MVP
"Hans de Korte" <hans.de.korte@.prominent.nl> wrote in message
news:06D0883E-6C6A-48F5-8205-58FA1B716BDF@.microsoft.com...
> Hello,
> I would like to create more lines by concatenating values.
> When I use: <select 'This' + ' ' + 'is' + ' ' + 'an' + ' ' + 'example'>
the result is <This is an example> (on the same line).
> I woul like to get:
> <This
> is
> an
> example> (each 'word' on a new line, but in 1 field)
> Whis SQL statement do i have to use?|||Thanks, I will try
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!
No comments:
Post a Comment