October 25, 2006 at 2:11 pm
Does anybody knows how to insert a carriage return into a text field? I have tried to use the ASCII code, it does not work.
Thanks!
--- Lu
October 25, 2006 at 2:13 pm
When you say that inserting the ASCII code for a CR doesn't work, what do you mean. How are you going about verifying that it doesn't work?
October 25, 2006 at 2:18 pm
I have added Chr(13) and Chr(10) in the string variable to update text field. But when I pulled the text back into my application. It did not show the carriage return there.
Thanks!
--- Lu
October 25, 2006 at 2:34 pm
Consider this example:
declare @table table (T1 text)
insert into @table (T1)
select 'test' + char(13) + ' test2'
select * from @table
In order to 'see' the results on two lines, you must view the query results in text (not grid). This shows that SQL Server is storing the CHAR(13) in the column. I would take this to mean that your application is not handling the results correctly.
October 25, 2006 at 10:21 pm
John is spot on...
I'll also add that storing text columns in the database is bad for too many reasons to post here. If you must store text that execeeds 8K characters and must not be parsed into multiple rows, store the info in a file and store the file name in the table.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 26, 2006 at 7:55 am
Thanks guys so much!
I have tried to put <BR> in the text string and it worked when the text field loaded into a rich textbox field.
Thanks!
October 26, 2006 at 5:23 pm
Outstanding... thank you for the feedback.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 7 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic. Login to reply