|
Subject:
|
How are Carriage Returns stored?
|
|
Posted By:
|
SQLScott
|
Post Date:
|
11/20/2006 3:22:11 PM
|
Suppose I have a varchar(max) column, in which the following is stored:
The brown fox jumped over the tall fence
Each line is separated via a hard carriage return. How is that carraige return stored in the varchar column? What do i look for to find that carriage return?
Scott Klein Author - Professional SQL Server 2005 XML http://www.wrox.com/WileyCDA/WroxTitle/productCd-0764597922.html
|
|
Reply By:
|
Jeff Moden
|
Reply Date:
|
11/30/2006 2:06:22 PM
|
Sorry, Scott... I've seen this question a couple of times and didn't realize no one answered.
The returns may be stored as any one of the following... CHAR(13) - Hard Carriage Return CHAR(10) - New Line Character (sometimes called a "Soft Return"_ CHAR(13)+ CHAR(10) - both
--Jeff Moden
|
|
Reply By:
|
steven_wort
|
Reply Date:
|
12/1/2006 3:07:02 PM
|
char (13) is a Carriage Return (CR) char (10) is a Line Feed (LF)
Windows OS's use both CR + LF to indicate a new line Unix OS's use just a LF ( or is it just a CR? its one or the other)
Depending on where the data comes from will depend on what chars are used to represent the new line.
If the data came from some other source such as a word processor, the string could be in a very different format such as RTF, or a word Document format.
If the data came from a web page then the line feed would be HTML, and could be either a </p> or a <br> or other line terminator sequence.
Co Author "Professional SQL Server 2005 Administration"
|