fmardani
Programmer
- Jul 24, 2003
- 152
The following query wworks fine.
It runs a dts package with the necessary parameters.
exec master..xp_cmdshell 'dtsrun /S UKSTMATD07 /E /N DTS_SendEmail /A Subject:8=ERROR /A SendTo:8=test@hotmail.com /A Body:8=d
BUT this one does not work because I am using a variable. The error message is: incorrect syntax near +
declare @email varchar(1000)
set @email = 'test@hotmail.com'
exec master..xp_cmdshell 'dtsrun /S UKSTMATD07 /E /N DTS_SendEmail /A Subject:8=ERROR /A SendTo:8=' + @email + ' /A Body:8=d
Do you know why
Thanks
It runs a dts package with the necessary parameters.
exec master..xp_cmdshell 'dtsrun /S UKSTMATD07 /E /N DTS_SendEmail /A Subject:8=ERROR /A SendTo:8=test@hotmail.com /A Body:8=d
BUT this one does not work because I am using a variable. The error message is: incorrect syntax near +
declare @email varchar(1000)
set @email = 'test@hotmail.com'
exec master..xp_cmdshell 'dtsrun /S UKSTMATD07 /E /N DTS_SendEmail /A Subject:8=ERROR /A SendTo:8=' + @email + ' /A Body:8=d
Do you know why
Thanks