• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 924
  • Last Modified:

Foreach Loop Containet problem in SSIS

I am trying t o use Foreach Loop container (Foreach Item Enumerator) to do some tasks with each table on the list. I entered the list of all table names I want to work with. I created the variable to hold the table name. I add execute sql task in the container.  I map the paramenter to previously created variable. I want to use this parameter in SQL statement but I am always getting an error:
-"drop table @tblName" 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.

-[Execute SQL Task] Error: Executing the query ""drop table '"+ @[User::TblName]+''''" failed with the following error: "Incorrect syntax near '+'.". Possible failure reasons: Problems with the query, "ResultSet" property not set correctly, parameters not set correctly, or connection not established correctly.

This is just 2 examples of what type of error I am getting. Can you please let me know how to set up and use parameters the right way ?

Thank you
0
crcsupport
Asked:
crcsupport
  • 2
  • 2
1 Solution
 
James MurrellProduct SpecialistCommented:
Be sure that the ResultSet drop down box has "None" selected
0
 
crcsupportAuthor Commented:
yes, it is "None"
0
 
James MurrellProduct SpecialistCommented:
other websites cooments

try and make a stored proc with same qury it will provide better error message
0
 
crcsupportAuthor Commented:
when I put it in sp it worked without any problems. Any ideas why ? I think I'll just put all operations in sp.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now