October 26, 2010 at 1:17 am
Hello
I have a query where I have to append line feed in one column result among 8 columns like below
Month Name Amount PaymentMode
January - 10 10000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123456
January - 10 70000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-908765
January - 10 30000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123432
How can I achieve this, any idea would be appreciated..
Regards,
October 26, 2010 at 4:00 am
either: CHAR(10)
or: CHAR(13) + CHAR(10)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 26, 2010 at 4:11 am
Its not working, I have checked it already.
Any other approach..?
October 26, 2010 at 4:35 am
please post the code of what you've tried.
You would also need to send the results to text (not grid)
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 26, 2010 at 4:48 am
xyzxyzxyzxyz123 (10/26/2010)
Its not working, I have checked it already.Any other approach..?
adding the line feed as Wayne described will work...but the results will not be visible in SSMS in gridmode.
because SSMS does not do "multiline" cells, CrLf/CHAR(13) + CHAR(10) characters are replaced with spaces for display purposes.
change to text mode (control + T) , rerun your query, and confirm the new lines are really in the data.
Lowell
October 26, 2010 at 6:20 am
xyzxyzxyzxyz123 (10/26/2010)
HelloI have a query where I have to append line feed in one column result among 8 columns like below
Month Name Amount PaymentMode
January - 10 10000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123456
January - 10 70000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-908765
January - 10 30000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123432
How can I achieve this, any idea would be appreciated..
Regards
Hi Wane and lowell are correct u need to use ctrl+T to view
Select Char(13)+'Test123465789'
or if u need space then you can use this it will be showen in grid and in text etc
Select SPACE(10)+'Test123465789'
Thanks
Parthi
Thanks
Parthi
December 24, 2016 at 11:05 am
parthi-1705 (10/26/2010)
HelloI have a query where I have to append line feed in one column result among 8 columns like below
Month Name Amount PaymentMode
January - 10 10000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123456
January - 10 70000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-908765
January - 10 30000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123432
How can I achieve this, any idea would be appreciated..
Regards,
Hi Wane and lowell are correct u need to use ctrl+T to view
Select Char(13)+'Test123465789'
or if u need space then you can use this it will be showen in grid and in text etc
Select SPACE(10)+'Test123465789'
Thanks
Parthi
December 24, 2016 at 11:06 am
parthi-1705 (10/26/2010)
HelloI have a query where I have to append line feed in one column result among 8 columns like below
Month Name Amount PaymentMode
January - 10 10000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123456
January - 10 70000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-908765
January - 10 30000 Credit Card [here line feed]xxxx-xxxx-xxxx-9897 [here line feed]Tran Detail-123432
How can I achieve this, any idea would be appreciated..
Regards,
Hi Wane and lowell are correct u need to use ctrl+T to view
Select Char(13)+'Test123465789'
or if u need space then you can use this it will be showen in grid and in text etc
Select SPACE(10)+'Test123465789'
Thanks
Parthi
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply