Domanda

I am working on writing a program to generate SSIS package which executes a query on multiple databases. I have already accomplished the task using a stored procedure however I don't want to use it. I have been struggling with Dts.runtime. I am using C#.

I have to read the query directly from the program and execute it, maybe using ExecuteSQLTask.Execute method. I am totally stuck, or it could be that I am thinking in wrong direction all together.

Please give me some insight into the problem.

È stato utile?

Soluzione

Just to be clear, the only execute method within Dts.Runtime is at the Package level. You don't need to call ExecuteSQLTask.Execute (no such thing, by the way) or anything in your C#.

Just build up your package's Executables, and then execute the package (or save it or whatever you want to do with it.) HINT: Use the SqlCommand property of the ExecuteSQLTask to set your command query from your program.

You'll also probably want to look into EzApi which makes building packages programmatically in C# a lot easier.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top