Wrox Programmer Forums
Go Back   Wrox Programmer Forums > SQL Server > SQL Server 2000 > SQL Server 2000
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 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:26 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 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 20th, 2006, 09:32 PM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

They can be stored several ways... CrLf (Carriage Return & Line Feed), just Cr, or just Lf (we won't talk about vertical tabs, here). Here's how you can represent each one of those characters in SQL (and several other languages, to boot!)...

Cr = CHAR(13)
Lf = CHAR(10)
CrLf = CHAR(13)+CHAR(10)

--Jeff Moden
 
Old November 23rd, 2006, 11:18 AM
SQLScott's Avatar
Wrox Author
 
Join Date: Dec 2004
Posts: 338
Thanks: 0
Thanked 2 Times in 2 Posts
Default

Thanks Jeff. That took me in the right direction...

Scott Klein
Author - Professional SQL Server 2005 XML
http://www.wrox.com/WileyCDA/WroxTit...764597922.html
 
Old November 24th, 2006, 10:37 AM
Friend of Wrox
 
Join Date: Oct 2006
Posts: 475
Thanks: 0
Thanked 9 Times in 9 Posts
Default

You bet... thank you for the feedback.

--Jeff Moden





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 2005 2 December 1st, 2006 04:07 PM
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.