jadams0173
Technical User
- Feb 18, 2005
- 1,210
I have changed an xp_sendmail procedure and now I get an error that says:
I'm using the @qry to return the data in an email.
Server: Msg 245, Level 16, State 1, Line 5
Syntax error converting the nvarchar value 'select PicklistID,SectorID,MO,Assembly,LineCount,DelPoint,Deltime
from WaitingForPicklist Where MyID = ' to a column of data type int.
I'm using the @qry to return the data in an email.
Code:
Declare @qry nVARCHAR(1000), @MyID int
set @myid = 1
set @qry = N'select PicklistID,SectorID,MO,Assembly,LineCount,DelPoint,Deltime
from WaitingForPicklist Where MyID = '+ @MyID
exec @qry