C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » SQL Server »

Sql query


Posted Date: 29 Nov 2008      Posted By: Binu Appukuttan      Member Level: Gold     Points: 1   Responses: 4



I have to replace ' with '' space my query is


update tabl set ext=repalce(ext,','')


i changed as update tabl set ext=repalce(ext,''','')
but still it showing error how to replace it..what is the right syntax.





Responses

Author: Yousuf    29 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 4

Update mytable set ext = SELECT REPLACE('abcdefghicde','cde','xxx')


Syntax
REPLACE ( 'string_expression1' , 'string_expression2' , 'string_expression3' )

Arguments
'string_expression1'

Is the string expression to be searched. string_expression1 can be of character or binary data.

'string_expression2'

Regards
Yousuf



Author: Sanjay Pal    29 Nov 2008Member Level: SilverRating: 2 out of 52 out of 5     Points: 3

REPLACE IS USED FOR REPLACING SOME CHARACTER FROM A STRING WITH ANOTHER STRING
SYNTAX IS AS FOLLOWS:

SELECT REPLACE ('STRING','CHARACTERTOREPLACE','NEWCHARACTERINPLACEOFCHARACTERTOREPLACE')



Author: Gaurav Agrawal    29 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 2

use this query i am sure it will done ur work

update tabl set ext=repalce(ext,'''','')

because

select ''''

it returns

'


GA

Thanks & Regards,

Gaurav Agrawal
Sr.Software Engineer
gaur1982@yahoo.com
09829373514



Author: Deepika Haridas    29 Nov 2008Member Level: DiamondRating: 2 out of 52 out of 5     Points: 1

you need to write within quotes

update tabl set ext=replace(ext, "'", "");

Regards,
Deepika



Thanks & Regards,
Deepika
Editor

If U want to shine like a SUN..First U have to burn like the SUN!!
Need a Guide? Join my mentor program..



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : SQL
Previous : Use of TOP keyword
Return to Discussion Forum
Post New Message
Category: SQL Server

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use