Collections:
Inserting New Line Characters into Strings in SQL Server
How To Insert New Line Characters into Strings in SQL Server Transact-SQL?
✍: FYIcenter.com
If you want to break a string into multiple lines, you need to insert new line characters into the string. With some client tools like SQL Server Management Studio, it is not so easy to insert a new line character.
One work around is to use the CHAR(int) function to generated new line character and other special characters with their code values:
The tutorial examples below gives you a good example
PRINT 'Welcome to '+CHAR(10)+'FYIcenter.com'; PRINT CHAR(10); PRINT 'Current date and time is ' +CONVERT(VARCHAR(20), GETDATE()); GO Welcome to FYIcenter.com Current date and time is May 19 2007 7:30PM
Â
⇒Character Strings and Binary Strings in SQL Server Transact-SQL
2022-05-12, 1841👍, 1💬
Popular Posts:
How To Install PHP on Windows in MySQL? The best way to download and install PHP on Windows systems ...
How to download and install SQL Server 2005 Sample Scripts in SQL Server? If you want to learn from ...
How To Count Duplicated Values in a Column in SQL Server? If you have a column with duplicated value...
How to continue to the next iteration of a WHILE loop in SQL Server Transact-SQL? How to use CONTINU...
How To List All User Names in a Database in SQL Server? If you want to see a list of all user names ...