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
 General SQL Server Forums
 New to SQL Server Programming
 Stuff a char(10) into a text string

Author  Topic 

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-02-03 : 12:21:36
I have a text column(old text datatype) in a db running on sql 2008R2. It has a great deal of data in each row. For aestetic purposes in the front end app, i would like to break up the data with a Char(10) carriage return after each period(.) in the data. Is there a way to use STUFF to get that char(10) in there repeatedly?

thanks

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-03 : 12:26:40
it wont
you need to be UPDATETEXT

http://msdn.microsoft.com/en-us/library/ms189466.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-03 : 12:27:46
or another easier way might be to cast it to varchar(max) and then apply STUFF

didnt understand why someone will be using text datatype in sql 2008 though as its deprecated and replaced by varchar(max)

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

WJHamel
Aged Yak Warrior

651 Posts

Posted - 2012-02-03 : 12:30:37
I've been complaining about the same thing. The engineers are happy to update a million other features that are rarely if ever used, but they ignore the deprecated features that keep getting moved forward even as we prepare to adopt sql azure.
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2012-02-03 : 12:31:51
hmm..
something that I've come across also

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page
   

- Advertisement -