3

I have an Execute SQL Task object in the Error handlers section of a SSIS package. What it does is inserting a record to a table using OLE DB connection. There is a value in the insert statement that should be sourced from a user variable.

When I try to pass the query I get the following error, I searched internet a lot and tried different things, but still get the error message:

"The query failed to parse. Parameter Information cannot be derived from SQL Statements. Set parameter information before preparing command."

What I have set to the SQLStatement is:

INSERT INTO ErrorLog(ErrorDateTime, ErrorDescription) VALUES(GETDATE(),?)

What I have in the Parameter Mapping section of the Task: enter image description here

The SQLSourceType is "Direct input" and as there is no result to this query the ResultSet has been set to "None".

The ErrorDescription column in the target table is varchar(max).

Any idea how fix this issue?

  • What type of connection manager is the database connection defined as? OLEDB? ADO.Net?... – brian Dec 5 '12 at 15:19
  • It is OLE DB connection, referring to a local database. – Sky Dec 5 '12 at 21:35
4

Have you actually tried executing the package or are you just trying to parse the query?

Attempting to parse OLE DB queries with params will fail with the error you've described. Don't parse the query if using OLE DB.

I've created your task and tested. It executes fine, but if you click "Parse query" it returns the same error that you are getting.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.