Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Characters from field in SQL table

Status
Not open for further replies.

Guest_imported

New member
Joined
Jan 1, 1970
Messages
0
I have a table with several thousand records and i need to remove certain characters from one particular field within that table. Can anybody tell me how i can do this? Can a SELECT statement, or REPLACE accomplish this? Any suggestion would be greatly appreciated.
 
your question seems a bit vague but lets assume that you are removing the same characters from all of the fields then it is a simple update query that will suffice

update tablename
set fieldname=replace(fieldname,'oldcharacters','newcharacters')


be sure to use a where clause if there are rows that you do not want the changes in and be careful you can make a mess in a hurry if you make a mistake

Hope this helps

Tal McMahon
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top