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 2012 Forums
 Transact-SQL (2012)
 replace query

Author  Topic 

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2014-08-15 : 12:43:24
hi i want to find certain text in an column and if it finds it removes it. i was trying the folowing
update dbo.BNYPortValInbound 
set SecurityName = replace(SecurityName, 'IRS: Flo/Fix:', '')
where AssetType='IRS' or AssetType='IFS'


i need some like the like '%%' can i use that in my query

rjhe22
Constraint Violating Yak Guru

283 Posts

Posted - 2014-08-15 : 13:05:31
got it working


UPDATE dbo.BNYPortValInbound
SET SecurityName = REPLACE(SecurityName, 'IRS: Flo/Fix:','')
WHERE InvestmentType='IfS'
AND SecurityName LIKE '%IRS: Flo/Fix: %'
Go to Top of Page
   

- Advertisement -