I am having trouble adding a field to a string. Right now I have a stored procedure running on a giant string (everything inside '') but I am running into problems when creating the Where statement.
I have:
' Cast(Name AS varchar(max)) NOT IN (''Jimmy' + CHAR(39) + 's'')'
But I am getting an error with the CHAR(39). How can I effectively make it look like Jimmy's inside the string? I know it's probably a stupid fix, but please help.