Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
IF variable contains string
Message
From
13/06/2008 17:20:43
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
 
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
SQL syntax
Title:
IF variable contains string
Environment versions
SQL Server:
SQL Server 2005
Miscellaneous
Thread ID:
01324006
Message ID:
01324006
Views:
114
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
Next
Reply
Map
View

Click here to load this message in the networking platform