Please start any new threads on our new site at We've got lots of great SQL Server experts to answer whatever question you can come up with.

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Find fist character if its '-' and replace space
 Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Starting Member

5 Posts

Posted - 08/12/2014 :  03:45:01  Show Profile  Reply with Quote

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


Aged Yak Warrior

United Kingdom
555 Posts

Posted - 08/12/2014 :  04:50:20  Show Profile  Reply with Quote
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!

Edited by - sz1 on 08/12/2014 04:56:41
Go to Top of Page
  Previous Topic Topic Next Topic  
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2019 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000