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
 SSIS and Import/Export (2005)
 Find fist character if its '-' and replace space

Author  Topic 

AngoloBanficio
Starting Member

5 Posts

Posted - 2014-08-12 : 03:45:01
Hi,

need to find the fist character if its '-' and replace space in the derived column.


thanks,
ab

sz1
Aged Yak Warrior

555 Posts

Posted - 2014-08-12 : 04:50:20
select CHARINDEX('_', 'Microsoft_SQL Server') -- find position = 10

-- to update the string part

Update [dbo].[YourTable]
Set YourColumn = REPLACE(YourColumn, '_', ' ')
where YourColumn LIKE '%_%'

We are the creators of our own reality!
Go to Top of Page
   

- Advertisement -