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 2005 Forums
 Transact-SQL (2005)
 How to add a carriage return into a SQL data field

Author  Topic 

KingCarlos
Yak Posting Veteran

74 Posts

Posted - 2010-03-26 : 00:33:46
I have the following data in the field mystreet

line 1 line 2 line 3

which appears in the application like

line 1 line 2 line 3

Now if I use the following SQLScript

update contacts
set mystreet = 'line 1
line 2
line 3'
where contactid = '_x01234'


The data will appear as

Line 1
Line 2
Line 3

Is there anyway to be able to do this as a bulk SQL Script???

pk_bohra
Master Smack Fu Yak Hacker

1182 Posts

Posted - 2010-03-26 : 00:44:51
Use char(13) function.

See this link for more details.
http://msdn.microsoft.com/en-us/library/ms187323.aspx


Regards,
Bohra

I am here to learn from Masters and help new bees in learning.
Go to Top of Page
   

- Advertisement -