SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

AngoloBanficio
Starting Member

Australia
5 Posts

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

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


thanks,
ab

sz1
Constraint Violating Yak Guru

United Kingdom
451 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  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.17 seconds. Powered By: Snitz Forums 2000