SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
Register Now and get your question answered!
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SSIS and Import/Export (2012)
 Can't get simple Ex SQL task to work w/ parameter
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Posting Yak Master

152 Posts

Posted - 11/22/2013 :  15:32:30  Show Profile  Visit malachi151's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.03 seconds. Powered By: Snitz Forums 2000