IF @Filename LIKE '%.doc%'>This is part of script. I want to only run the code if the @Filename contains the string ".doc" but I'm getting an error on the syntax.
>Msg 102, Level 15, State 1, Line 133 >Incorrect syntax near '@Filename'. > > IF CONTAINS(@Filename, '.doc') > Set @CONVERTSCRIPT = 'c:\Tiff\RTFConverter.exe "' + @DocumentID + '|c:\ImpactMD\Export\' + @DocumentID + '.rtf"' > Print 'Convert Script - ' + @CONVERTSCRIPT > exec master.dbo.xp_cmdshell @CONVERTSCRIPT, no_output >