Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Can't get simple Ex SQL task to work w/ parameter

Author  Topic 

malachi151
Posting Yak Master

152 Posts

Posted - 2013-11-22 : 15:32:30
I'm just trying, at this point, to do a simple text and I can't get even the most basic thing to work.

I'm using SSIS for 2012, and connecting to a 2012 instance.

My Execute SQL task just has a simple OLE DB connection. BypassPrepare is False. I test the connection and it works.

If I start with a simple "SELECT C FROM T" this parses and works.

Then I set SQLStatement to "SELECT C FROM T WHERE C = ?" (C is a valid column name and t is a valid table name)

And I add a Parameter Mapping, and just create a variable using <New variable>, set it to Input, Data type LONG, ParameterName 0, ParaemterLength -1.

The variable is created as an Int32, with a value of 1.

When I parse it I get:

"The query failed to parse. The batch could not be analyzed because of compile errors."


In addition, if I go back and open up some old 2008 packages that had Execute SQL statements in them with parameters, and I convert them, and then open them and open the Execute SQL tasks and try to parse them, then I get the same exact error, even though those packages work just fine in BIDS.

Any ideas?

I've tried this using both SSDT 2012 and SSTD 2010.

--------------------------------------------------
My blog: http://practicaltsql.net/
Twitter: @RGPSoftware
   

- Advertisement -