Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 SQL server text data type

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-01-09 : 08:34:02
Samarth writes "Hello,
Here is my problem:
I'm reading some data and updating a particular field in the database.The data type of this field is text.
When i'm reading the data from the front end, I apply an enter(termination char) as a delimiter and then update it to the SQL Server database.So the data from front end looks like this :

I'm
being
split
into
parts

When I update this to the database and retrieve it(from the text datatype field) it looks like this :

I'm being split into parts


Is there any problem with the code or is it with the server?

Sam"

nr
SQLTeam MVY

12543 Posts

Posted - 2003-01-09 : 08:58:45
create table #a (s text)
insert #a select 'I''m
being
split
into
parts'
select * from #a

gives

s
----------
I'm
being
split
into
parts


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-01-09 : 09:07:24
If you're retrieving/displaying that column on a web page, realize that HTML does not render a CRLF in the data as a line break. You'd have to use REPLACE() to change them to the HTML <br> tag.

Go to Top of Page

nr
SQLTeam MVY

12543 Posts

Posted - 2003-01-09 : 09:28:49
I've just come across the same problem with someone trying to save a swift message in a text field.
Are you the same person?

That one used to work when it was a varchar field which implies it's not the display method but something to do with the insert/extract.

Can you post the code you are using and what is the front end.


==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

Robwhittaker
Yak Posting Veteran

85 Posts

Posted - 2003-01-09 : 09:38:45
It could be a problem with carriage return characters. Things like VB use return characters, but if you're not saving them to the database in the string, for some reason, when you select the string from the database it will be on one line.



Go to Top of Page
   

- Advertisement -