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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 how to replace and update in a field

Author  Topic 

udaymahajan
Starting Member

17 Posts

Posted - 2008-12-22 : 13:09:02
i m using Ms Sql 2005
my table is as follows

brokerid brokername
1 "Abc
2 "DEF
3 XYZ"

i want to remove " from brokername column and update records like

brokerid brokername
1 Abc
2 DEF
3 XYZ

so how can i use query or any other way to solve this.
Thank You

uday

sakets_2000
Master Smack Fu Yak Hacker

1472 Posts

Posted - 2008-12-22 : 13:12:42
use replace function
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2008-12-22 : 13:56:41
UPDATE table1
SET brokername = REPLACE(brokername, '"', '')

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -