Alter Bulk Insert location via Script task

  • Okay, firstly I'm a newbie to Integration Services so excuse me if I'm being dense.

    I have a package that releases tables to various servers which I've put in a loop changing the connection string dynamically every time, this is fine (SSIS is nice for things like that).

    My question now is this, the table names I have are flagged with a version number for the release i.e. table_v23, this isn't a problem for the OLE DB Source as I just set the query up as a package variable and run the variable but the table needs to be called the same thing at the other end.

    I've set up a SQL Server destination and obviously need to change the BulkInsertTableName property, so how do I do this via script?

    I found something on the MSN blogs saying to use something like:

    SetComponentProperty("BulkInsertTableName","[tablename]")

    Where would I reference the component name to set this property?

    Cheers in advance.

  • Firstly, the SQL Server Destination component will only connect to a SQL instance running on the same machine as SSIS so you cannot connect to another server.

    Secondly, you cannot change the meta data of a control flow at run time. i.e. You cannot change the table you are trying to write to. Well, you cannot do it through SSIS. The code you supplied, I suspect, is used if you are building a package on the fly with C# or VB.net.

    Cheers,CrispinI can't die, there are too many people who still have to meet me!It's not a bug, SQL just misunderstood me!

  • Cheers. I ended up using a global variable to create the table each time and then dumping to an OLE DB destination connected to the table via variable.

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

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