SQL and new line / escape chars

09/10/2007 - 15:10 von jubbe | Report spam
Hi all,
I just have started to use SQL Server (Express) version and I
have used an other database before.
Now I want to store a string in a db field where the string is
build like a "c" standard string such as "first line.another line"
where "" is the placeholder for "new line" 0x0d hex.


INSERT INTO "testtab" (
"comment"
)
VALUES
(
'first line next line'
);

(comment field is varchar(50) )


Is it possible that SQL Server does not support "c escaped"
char sequences ???

Rgds, Jubbe
 

Lesen sie die antworten

#1 Olaf Pietsch
09/10/2007 - 15:54 | Warnen spam
"jubbe" schrieb im Newsbeitrag
news:

Is it possible that SQL Server does not support "c escaped"
char sequences ???



yes.
use this:
INSERT INTO "testtab" (
"comment"
)
VALUES
(
'first line
next line'
);
or use char(...) function
http://msdn2.microsoft.com/en-us/li...87323.aspx
or use a CLR function for formatting the string

Gruß Olaf
Ich unterstütze PASS Deutschland e.V. (http://www.sqlpass.de)
Regionalgruppe Köln/Bonn/Düsseldorf
(http://www.sqlpass.de/Regionalgrupp...fault.aspx)

Ähnliche fragen