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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Writer SQL which remove '{' and '}' char 1

Status
Not open for further replies.

amardesai2005

Programmer
Sep 1, 2005
14
US
Is any one know how do i remove { charchter from sql table.

I have table called Products and there is field called GUID
which has data like this

{00020409-78E1-11D2-B60F-006097C998E7}
{00040409-78E1-11D2-B60F-006097C998E7}
Windows 2000 Service Pack
Q828026

Now I want to write a query which will remove '{', '}' character if it's exist.

Let say for above data i need out put like this

00020409-78E1-11D2-B60F-006097C998E7
00040409-78E1-11D2-B60F-006097C998E7
Windows 2000 Service Pack
Q828026

Is anybody can help me out

Thanks for your help
AD
 
I don't know if you can repl;ace those in a GUID field if you can here is the code to do it

use a replace function

update table set GUID = replace(replace(GUID,'{',''),'}','')

declare @v varchar(50)
select @v ='{00020409-78E1-11D2-B60F-006097C998E7}'
select replace(replace(@v,'{',''),'}','')



Denis The SQL Menace
SQL blog:
Personal Blog:
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top