Execute Stored Procedure via Execute SQL Task
Do you know of a bug in the June CTP of SSIS where you cannot, using an Execute SQL Task, execute a stored procedure with parameters via an OLE DB connection? For example, one combination I tried was in the SQL Statement, I have: EXEC dbo.DimBuild ?,? And in the parameter mapping, I added two date user variables, both with parameter name ? -- I also tried EXEC dbo.DimBuild sd, ed And in the parameter mapping, I added two date user variables, one with a parameter name sd and the other ed -- I tried many other combinations as well. The error I would get would say parameter name unrecognized. [Execute SQL Task] Error: Executing the query "dbo.DimBuild sd, ed" failed with the following error: "Parameter name is unrecognized.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly. Is there something wrong with my syntax? Interestingly, I tried executing the stored procedure using an ADO.Net connection, with similar parameter mappings, and it worked just fine. Thanks, - Joel
August 19th, 2005 1:28am

I was banging my head against the wall trying to figure this out also. I finally created a simple DTS package with an Execute SQL task running a parameterized query. When I migrated it to SSIS, I found the parameter name was 0.I modified the package I was working on to use parameter names 0 and 1 (with "exec sproc ?, ?" as the query) and it succeeded.Don't you just love the great documentation?
Free Windows Admin Tool Kit Click here and download it now
August 31st, 2005 1:09am

I know the documentation lacks on this. In this post http://forums.microsoft.com/msdn/ShowPost.aspx?PostID=57637 Kirk has given us indication which Parameters can be used with which connection manager etc.
August 31st, 2005 10:23am

This is documented so good! I only spent like 2 hours finding out that you have to use ? and 0. Why is it so hard to just put it in a help file somewhere? Or maybe it is and i did not find it. Besides this SSIS is great package i think. Sometimes totally incomprehensible error messages but great anyway. Sutha Thiru, the link you provided does not work?
Free Windows Admin Tool Kit Click here and download it now
July 13th, 2009 3:55pm

Even though this issue is old, this might be useful to others. This exact error happened to me when I used an "Execute SQL Task" component using an OLEDB connection to a SQL Server. I did 2 things to fix it: 1. Test your connection string to ensure that the DB connection is testing out properly. 2. Include an "@" symbol before the parameters. This issue is a weird quirk since there is very little documentation on whether to include the "@" symbol or not. Hope it helps!
September 16th, 2009 12:41am

Well, after wasting 2-3 hours in finding solution of this problem, finally I could make it work with the following statement directly entered in the SQLStatement property and with SQLSourceType = Direct Input. {call schema.my_stored_proc ('param1val','param2val')} In my scenario I was using a Microsoft OLE DB Provider for Oracle. But, still using the convention for OLE DB (which is EXEC SP_name) didn't work for me. Instead of that the convention for ODBC worked well, which I pasted above. Refer to this link to understand the conventions and what I am talking about here: http://technet.microsoft.com/en-us/library/cc280502.aspx Hope this helps. ~Saggy...
Free Windows Admin Tool Kit Click here and download it now
December 7th, 2010 4:19pm

awesome awesome awesome. hidden documentation, easter egg!!
January 6th, 2011 7:23pm

Argh SSIS is annoying. I'm new to this ETL tool, however, it's really not intuitive at all. I'm trying to perform the same thing without any luck! I've got an execute SQl task, using the following query. DECLARE @jobIdFromQuery INT exec @jobIdFromQuery = dbo.ins_job @jobName=myJob, @userName=MyName, @password=null, @asofDate=null, @jobId=null SELECT jobIdFromQuery=@jobIdFromQuery This works, with the constants @jobName=myJob, @userName=MyName, however, when I try changing these constants to a input variable "@jobName=?, @userName=?" It does not work! Any ideas/suggestions?
Free Windows Admin Tool Kit Click here and download it now
April 8th, 2011 5:37pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics