Inserting New Line Characters into Strings in SQL Server
How To Insert New Line Characters into Strings in SQL Server Transact-SQL?
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, 3373👍, 1💬
Where to find Oracle database server tutorials? Here is a collection of tutorials, tips and FAQs for...
Where to find answers to frequently asked questions on Storage Engines: MyISAM, InnoDB and BDB in My...
What Are Out-of-Range Errors with DATETIME values in SQL Server Transact-SQL? When you enter DATETIM...
How To Get the Definition of a Stored Procedure Back in SQL Server Transact-SQL? If you want get the...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...