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
 General SQL Server Forums
 Database Design and Application Architecture
 Can someone help with an update please
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

cgcourson
Starting Member

3 Posts

Posted - 01/16/2013 :  12:21:02  Show Profile  Reply with Quote
I need to update a table in my db and need some help with the syntax.

I have two variations of data in the same column
e.g.
1. "_ 199976 _"
and
2. "199976"

I need to remove the "_ " from the front and back end of the numerals in the entire table which has 50,000 rows

let me now if you can help

Chris

James K
Flowing Fount of Yak Knowledge

3557 Posts

Posted - 01/16/2013 :  12:24:45  Show Profile  Reply with Quote
UPDATE Tbl SET theColumn = LTRIM(RTRIM(REPLACE(theColumn,'_','')));
Go to Top of Page

cgcourson
Starting Member

3 Posts

Posted - 01/16/2013 :  12:27:48  Show Profile  Reply with Quote
Thank you so much
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.03 seconds. Powered By: Snitz Forums 2000