Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

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?

Thanks in advance.

share|improve this question
    
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. –  Nazila Beikpour Dec 5 '12 at 21:35
add comment

1 Answer

up vote 2 down vote accepted

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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