September 27, 2005 at 4:12 pm
I admit this is a silly question. But really appreciate if you could help. I have formatted text saves in a varchar column and the format, particularly newline, must be retrievable. However my query result shows that the newline is gone. So should I save the newline if possible? Or what can I do if varchar doesn't do newline?
Thanks a lot.
John
September 27, 2005 at 9:06 pm
I'm not quite sure how to answer this as I do not know what your front-end is doing. But here is an example of how to force line feeds:
DECLARE @LineFeed TABLE( Verbiage varchar(50))
INSERT INTO @LineFeed
SELECT 'THIS ' + CHAR(10) + 'AND THAT'
INSERT INTO @LineFeed
SELECT 'THIS ' + CHAR(13) + 'OR THAT'
SELECT * FROM @LineFeed
I wasn't born stupid - I had to study.
September 28, 2005 at 12:04 am
thanks for reply.
I'm importing data from Informix where text format is well saved in a blob column. the newline in the Informix export file is clear. but after imported into SQL, mapped to varchar/varchar(max), the newline is gone. query result doesn't have newline so doesn't have line break.
if there isn't a direct solution, I can try pre-process the exported file adding in the 'char(n)' probably...
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy