Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2005 > SQL Server 2005
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 20th, 2006, 04:22 PM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default How are Carriage Returns stored?

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/WroxTit...764597922.html
__________________
========================
Scott Klein
Author of:
Professional SQL Server 2005 XML
Professional WCF Programming: .NET Development with the Windows Communication Foundation
Professional LINQ
========================
 
Old November 30th, 2006, 03:06 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

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
 
Old December 1st, 2006, 04:07 PM
Wrox Author
 
Join Date: Dec 2006
Posts: 17
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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"





Similar Threads
Thread Thread Starter Forum Replies Last Post
display carriage returns in label bleitner ASP.NET 2.0 Professional 4 May 21st, 2011 12:10 PM
for-each carriage returns TiLaser XSLT 4 April 28th, 2008 07:31 PM
Stored Proc that returns a value elygp SQL Server 2000 4 May 9th, 2007 01:05 AM
How are Carriage Returns stored? SQLScott SQL Server 2000 3 November 24th, 2006 10:37 AM
Stored Proc returns closed recordset ? xgbnow Pro VB Databases 10 March 26th, 2004 06:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.