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)
 Search & Replace in TEXT column

Author  Topic 

skysyb
Starting Member

16 Posts

Posted - 2009-09-11 : 08:46:09
Hi All,

is there a way that we could SEARRCH for something called 'ABC' and update that to 'XYZ' in a TEXT column of 60GB table and each row of texcolumn length is approximately 6MB ?

although it's a 60GB table - the number of rows in the table are only 30,000.

Appreciate any feedback on this.

Thanks in advance !

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2009-09-11 : 16:08:45
update MyTable
set MyText = replace(cast(MyText as varchar(max)), 'ABC', 'XYZ')

=======================================
Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727)
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-13 : 13:46:01
http://www.sqlteam.com/article/search-and-replace-in-a-text-column
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2009-09-13 : 13:50:19
forgot to add,text is deprecated in sql 2005. So if possible,Its better to use varchar(max) instead
Go to Top of Page
   

- Advertisement -