Site Sponsored By: SQLDSC - SQL Server Desired State Configuration
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.
I'm having an issue with a list as follows:WHEN invheader.APVendorName IN ('SOUTHWEST INTERNATIONAL TRUCKS','SOUTHWEST INTERNATIONL TRUCKS','SOUTHWEST INT'L TRUCKS','SOUTHWEST INT'L TRUCKS, INC.') THEN 'SOUTHWEST INTL TRUCKS'It's giving me syntax error because of the single quote in INT'L which is in between to single quotes for the string. Does anyone know how to solve this? Thanks.
visakh16
Very Important crosS Applying yaK Herder
52326 Posts
Posted - 2008-07-28 : 11:05:35
put one more ' to escape it
WHEN invheader.APVendorName IN ('SOUTHWEST INTERNATIONAL TRUCKS','SOUTHWEST INTERNATIONL TRUCKS','SOUTHWEST INT''L TRUCKS','SOUTHWEST INT''L TRUCKS, INC.') THEN 'SOUTHWEST INTL TRUCKS'
osupratt
Posting Yak Master
238 Posts
Posted - 2008-07-28 : 11:08:01
wow. thanks. never figured that out.
madhivanan
Premature Yak Congratulator
22864 Posts
Posted - 2008-07-28 : 11:11:39
http://sqlblogcasts.com/blogs/madhivanan/archive/2008/02/19/understanding-single-quotes.aspxMadhivananFailing to plan is Planning to fail