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

Trouble with Update Statement For Records with Apostrophe

Status
Not open for further replies.

bmann

Programmer
Oct 8, 2002
128
US
Hello. I am having trouble with the Update SQL statement in sql analyzer. I am trying to change the lastname O'NEIL to
ONEIL.

Let me Explain:

Field Data

Last O'NEIL


I want to change Data to take the apostrophe from name:

Field Data

Last ONEIL



Here is my code:

Update cal.dbo.name
set last = Replace(last , "'", "")
where last LIKE 'O''NEIL%'


This is the error I get.

Server: Msg 1038, Level 15, State 3, Line 2
Cannot use empty object or column names. Use a single space if necessary.
 
I guess I thought I was in the sql server forum. Sorry.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top