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.
| Author |
Topic |
|
TPie9
Yak Posting Veteran
67 Posts |
Posted - 2009-08-25 : 13:15:10
|
| Below is my SQL code and corresponding error I receive: select *from Saleswhere SalesRep = 'George O'Malley'"Msg 102, Level 15, State 1, Line 3Incorrect syntax near 'Malley'.Msg 105, Level 15, State 1, Line 3Unclosed quotation mark after the character string '''.Any ideas how to accomplish my look up on the salesrep name that contains a quotation?Thanks |
|
|
YellowBug
Aged Yak Warrior
616 Posts |
Posted - 2009-08-25 : 13:17:30
|
| select *from Saleswhere SalesRep = 'George O''Malley'Put two quotes by the O. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-25 : 13:17:48
|
You can mask a single quote by typing two single quotes.where SalesRep = 'George O''Malley'edit: typo corrected No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
webfred
Master Smack Fu Yak Hacker
8781 Posts |
Posted - 2009-08-25 : 13:19:14
|
 No, you're never too old to Yak'n'Roll if you're too young to die. |
 |
|
|
TPie9
Yak Posting Veteran
67 Posts |
Posted - 2009-08-25 : 13:22:09
|
| Thanks for the help because it accomplished what I needed. |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|