April 9, 2009 at 3:40 am
Hello Guys,
In SSIS Package I created a Execute SQL Task and tried the following query
SELECT COUNT(*) FROM MASTER.DBO.SYSSERVERS WHERE SRVNAME = ?
with a variable defined as LSNAME and mapped it in SQL Task.
the above query executed successfully
but for the same window if i change the query to below one
DECLARE
@server VARCHAR(8000)
SET @server = ?
SELECT COUNT(*) FROM MASTER.DBO.SYSSERVERS WHERE SRVNAME = @server
execute SQL task fails to execute and gives error as "Syntax error , permission voilation or other nonspecific error "
????????? any help please
April 9, 2009 at 7:15 am
Try this
SELECT COUNT(*) FROM MASTER.DBO.SYSSERVERS WHERE SRVNAME = ?
Leave the mappping as is.
April 9, 2009 at 7:17 am
Also, what did u set the result set as?
April 9, 2009 at 9:18 am
Set the "Bypass Prepare" property to "True" .
Cheers!
April 12, 2009 at 11:00 pm
Yahoooooooooooooo !
After Setting "Bypass Prepare" property to "True" it executed succesfully....thanks a lot.
can anybody know why its happening? without that why it won't work?
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply