SELCT FROM Problem

  • Hello SQLers.

    This sounds like a really dumb question but I'm really stumped on this one.

    I have a database table with a column NAME (which is a string) and there are entries in this column with apostrophes. When I try to execute a simple query like

    select * from ThisTable where Name = 'Mike's Ball'

    I have an error because of the apostraphe in Mike. If I am allowed to write this character, I'm assuming there is a way to query it .... I JUST CAN'T FIGURE OUT WHAT IT IS! HELP! I'M GOING CRAZY MAN!!

  • select * from ThisTable where Name = 'Mike''s Ball'

     

    hth

    David

  • You should also take a look at QUOTENAME:

    http://msdn2.microsoft.com/en-us/library/ms176114(SQL.90).aspx

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply