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
⇒ CHARINDEX() and SUBSTRING() - Locating and Taking Substrings in SQL Server
⇐ Character String Functions Supported by SQL Server 2005 in SQL Server
⇑ Character Strings and Binary Strings in SQL Server Transact-SQL
2022-05-12, 7475🔥, 1💬
Popular Posts:
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...
How To Break Query Output into Pages in MySQL? If you have a query that returns hundreds of rows, an...
How To Use GO Command in "sqlcmd" in SQL Server? "sqlcmd" is a command line client application to ru...
Where to find answers to frequently asked questions I am new to Oracle database. Here is a list of f...
How To Divide Query Output into Multiple Groups with the GROUP BY Clause in SQL Server? Sometimes, y...