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)
 single quote replacemnt through sql function

Author  Topic 

desikankannan
Posting Yak Master

152 Posts

Posted - 2010-02-17 : 11:48:57
i wants to write a sql function to remove the single quote given by the user in the front end, i wants to check in the back end , whether user is giving any single quotes ,if any single quote ,i should replace with double quotes.


Desikankannan

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-17 : 11:51:51
use REPLACE

REPLACE(Yourcol,'''','"')

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-02-17 : 11:57:24
also see

http://beyondrelational.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspx

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-02-18 : 01:08:55
quote:
Originally posted by desikankannan

i wants to write a sql function to remove the single quote given by the user in the front end, i wants to check in the back end , whether user is giving any single quotes ,if any single quote ,i should replace with double quotes.


Desikankannan


Why dont you check this at the front end itself?

Madhivanan

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

- Advertisement -