Very simple and very effective. We use all the time for many reasons – formatting, while creating dynamically generated SQL to separate GO command from other T-SQL, saving some user input text to database etc. Let us learn about T-SQL Script to Insert Carriage Return and New Line Feed in Code.
DECLARE @strPrint VARCHAR(100); SET @strPrint = 'Example of carriage return'; SET @strPrint = @strPrint + CHAR(13); SET @strPrint = @strPrint + 'SQLAuthority.com'; PRINT @strPrint; GO PRINT '---------------------------------' DECLARE @strPrint VARCHAR(100); SET @strPrint = 'Example of new line feed'; SET @strPrint = @strPrint + CHAR(10); SET @strPrint = @strPrint + 'SQLAuthority.com'; PRINT @strPrint; GO
Example of carriage return
Example of new line feed
A CSV is a comma separated values file, which allows data to be saved in a table structured format. CSV files are plain-text files, which makes them easy for the website developer to create. Because the CSV is plain-text, it makes the data easy to import into any spreadsheet program or database regardless of what type of computer or software program you are using. CSVs look like a garden-variety spreadsheet, but with a .csv extension.
Let me know your thoughts about this blog post.
Reference: Pinal Dave (http://blog.SQLAuthority.com)