Execute SQL Task In SSIS Using Scripting

  • Dear All,

    I want to use “execute SQL Task” in scripting in SSIS.How to create object of “Execute SQL Task” using scripting. I want to set SQL statement dynamically.That's why I want to do this by using scripting.

    Please suggest me .How to do this?

    Regards,

    Rajesh

  • Hi,

    In DTS Packages we have Active X script task and there we say

    Set pkg = DTSGlobalVariables.Parent

    Set tsk = pkg.tasks("DTSTask_DTSExecuteSQLTask_1")

    Set cus = tsk.CustomTask

    cus.SQLStatement = <<your statement>>

    In SSIS, I dont think you have this facility. All I can say is

    Put your query in a global variable of type string and in the Execute SQL Task give the source as Variable and then pick your global variable from the list.

    If your string length is less than 4000, then this will work fine.

    I am not sure if the length is > 4000 characters.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply