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
 Find/Replace on data in specific column

Author  Topic 

port43
Starting Member

19 Posts

Posted - 2011-01-21 : 02:17:03
Okay. I believe I've done due diligence in looking for an answer as I've been coming through the forums for about two hours now.

I've got an MS SQL table that contains around 1900 rows in which one particular column contains data such as:




*REFURB-MEMPHIS, QUEUE


ITPROD, ENTERPRISE SYSTEMS


*ACCT, QUEUE: 147289; THOMPSON, FRANK: 24919


*ENTERPRISE SYSTEM, QUEUE, *DATA INTEGRATION, QUEUE


*TRPN, QUEUE: 147290


etc...


etc...




I would like to do a global change where I can drop all instances of '*' as well as removing the string 'QUEUE,'

Is this a fairly simple task?

Thank you for your attention!

blessings,
Tony <><

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2011-01-21 : 02:21:51
[code]
update t
set somecol = replace(somecol, 'QUEUE', '')
from yourtable t
where somecol like '%QUEUE%'
[/code]


KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

port43
Starting Member

19 Posts

Posted - 2011-01-21 : 02:26:30
Thank you so much!

blessings,
Tony <><
Go to Top of Page
   

- Advertisement -