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 2008 Forums
 Transact-SQL (2008)
 Replace in SQL

Author  Topic 

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2012-01-04 : 03:54:08
How to replace in SQL
Ths string is below like 'Nagarajan V,Balamurugan'

but i want below format
'Nagarajan V','Balamurugan'

how to replace using sql



V.NAGARAJAN

sql-programmers
Posting Yak Master

190 Posts

Posted - 2012-01-04 : 04:14:46
Use this it may help.


declare @str varchar(200) ='Nagarajan V,Balamurugan'
print @str
select replace(@str, ',', ''',''')

SQL Server Programmers and Consultants
http://www.sql-programmers.com/
Go to Top of Page

itnagaraj
Yak Posting Veteran

70 Posts

Posted - 2012-01-04 : 04:19:04
OK good.Thanks for your help

quote:
Originally posted by sql-programmers

Use this it may help.


declare @str varchar(200) ='Nagarajan V,Balamurugan'
print @str
select replace(@str, ',', ''',''')

SQL Server Programmers and Consultants
http://www.sql-programmers.com/



V.NAGARAJAN
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2012-01-04 : 04:50:19
quote:
Originally posted by itnagaraj

How to replace in SQL
Ths string is below like 'Nagarajan V,Balamurugan'

but i want below format
'Nagarajan V','Balamurugan'

how to replace using sql



V.NAGARAJAN


Are you using this to pass as a parameter value?

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -