Generate package-wide GUID variable

  • Hi All,

    I'm a bit of an SSIS noob and I'm hoping to get some help. I'm using BIDS 2005. I need to generate a GUID which I can append to several different data streams. My first thought was to run an Execute SQL task that basically says

    select batch_id = cast(newid() as char(36))

    Then assign that value to a variable. Problem is I'm not sure how to configure the stage for that, and since I'm not savvy with SSIS, I'm having trouble succinctly searching for this problem online. Can anyone help me with how to configure the task to do this assignment, or maybe suggest a better way to get a guid into a variable when the package runs?

    Executive Junior Cowboy Developer, Esq.[/url]

  • Perhaps there is an alternative.

    There is a system variable in SSIS called the ExecutionInstanceGUID.

    This is a GUID generated every time a package runs – it uniquely identifies a single run of a single package. Can you use that & avoid having to make a SQL Server call completely?

    See here for more details.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • That's exactly what I needed. Thanks!

    Executive Junior Cowboy Developer, Esq.[/url]

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

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