Re: How do I preserve carriage returns in SQL?

From: Daniel Crichton (msnews_at_worldofspack.co.uk)
Date: 03/21/05


Date: Mon, 21 Mar 2005 16:51:39 -0000

Joseph wrote on Mon, 21 Mar 2005 10:44:29 -0500:

> How do I preserve carriage returns in my SQL statement? See the update
> statement below. The value for the Alert field is:
>
> 'Alert1
> Alert2
> Alert3
> Alert4'
>
> However, when I read this back from the database, I get 'Alert1 Alert2
> Alert3 Alert4'. I guess I could convert vbCRLF to '|' and vice versa when
> I get the data back from the database. But this would eliminate the pipe
> character as a legal data character. Is there a more standard approach?
>
> Thanks for your help!
>
> - Joe Geretz -
>
> UPDATE PERSONALERTS
> SET ALERTID = 1,
> ISPRIVATE = 'N',
> ISDELETED = 'N',
> CREATEDBY = 1,
> CREATETIME = '03/21/2005 10:36',
> MODIFIEDBY = NULL,
> MODIFYTIME = NULL,
> DELETEDBY = NULL,
> DELETETIME = NULL,
> ALERT = 'Alert1
> Alert2
> Alert3
> Alert4'
> WHERE PERSONID = 9367
>

How are you sending this SQL statement to your server? I've just tried
something similar on mine in SQL Query Analyzer and it stores and returns
the line breaks fine.

Dan



Relevant Pages

  • Re: Need help with Perl regex
    ... Let's spread that regex out a bit, which we can actually do in Perl code ... #or preceded by a pipe symbol ... [#begin a character class ... The perlretut, perlrequick, perlre, and perlreref documents that come ...
    (comp.lang.perl.misc)
  • Re: re keyboard keys
    ... The character you're referring to is called a pipe. ... You're problem is confusing unless you have an unusual keyboard or some key ... I have english set for region settings on all the tabs in ...
    (microsoft.public.windowsxp.basics)
  • Re: AS400 + Client Access EBCDIC to ASCII translation error: pipe to shriek
    ... the pipe will be translated to a shriek character ... of AS400 o/s and client access installations. ...
    (comp.sys.ibm.as400.misc)
  • Re: Process Synchronization using Pipes
    ... You continue even if you are unable to create a pipe. ... for all the lines if each child would loop ... To readall character are just the same. ... especially those for the low level I/O functions ...
    (comp.unix.programmer)
  • Re: Process Synchronization using Pipes
    ... You continue even if you are unable to create a pipe. ... for all the lines if each child would loop ... To readall character are just the same. ... especially those for the low level I/O functions ...
    (comp.unix.programmer)