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
 General SQL Server Forums
 Database Design and Application Architecture
 Can someone help with an update please

Author  Topic 

cgcourson
Starting Member

3 Posts

Posted - 2013-01-16 : 12:21:02
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
Master Smack Fu Yak Hacker

3873 Posts

Posted - 2013-01-16 : 12:24:45
[code]UPDATE Tbl SET theColumn = LTRIM(RTRIM(REPLACE(theColumn,'_','')));[/code]
Go to Top of Page

cgcourson
Starting Member

3 Posts

Posted - 2013-01-16 : 12:27:48
Thank you so much
Go to Top of Page
   

- Advertisement -