I am getting records from database as comma separated. I am getting contact titles as:
greg w.workcerf, ashir ali, asdddfgjk
This is comma separated has been defined in SQL function getCommaListTitle()
What i want is to get these record on new lines as
greg w.workcerf,
ashir ali,
asdddfgjk
Any idea about what should i use in sql function instead of ','
SQL Server -- using new line feed: CHAR(10) SELECT 'First line. '+ CHAR(10) + 'Second line. ' AS 'New Line' -- using carriage return: CHAR(13) SELECT 'First line. '+ CHAR(13) + 'Second line.
The "N" prefix stands for National Language in the SQL-92 standard, and is used for representing Unicode characters.
Remove and Replace Carriage Returns and Line Breaks in SQL Using SQL to remove a line feed or carriage return means using the CHAR function. A line feed is CHAR(10); a carriage return is CHAR(13).
Append after the comma in getCommaListTitle
, CHAR(13) + CHAR(10)
for a
new line
CHAR(13)
is a new line char and CHAR(10)
is a line feed.
See http://msdn.microsoft.com/en-us/library/ms187323.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With