How you get new line or line feed in Sql Query ?
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).
If this feature is not turned and you need to go to a particular line number press CTRL + G to open the Go To Line dialog box, enter line number and click OK as shown below.
Yes, it is perfectly fine to add newlines ( \n or \r\n ) to your query. Most parsers consider newlines as whitespace (just like a space or tab), and so does the one used by Oracle (and all other database I have used).
Pinal Dave explains this well in his blog.
http://blog.sqlauthority.com/2009/07/01/sql-server-difference-between-line-feed-n-and-carriage-return-r-t-sql-new-line-char/
DECLARE @NewLineChar AS CHAR(2) = CHAR(13) + CHAR(10) PRINT ('SELECT FirstLine AS FL ' + @NewLineChar + 'SELECT SecondLine AS SL')
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