Master/Driver Package and Expression to Set Variable - Be Careful

  • I have been using SSIS for a while now, originally in SQL 2008 but more lately SQL 2012.

    I discovered the GETDATE() function in SSIS so I thought I would use this in a variable expression in a Master/Driver package with the child parameters mapped to this variable. A big mistake. The value is not persisted, it gets updated each time the variable is read, so it's back to setting the variable value using a script task in the Master/Driver package.

    Just thought I would pass this on in case anyone makes the same mistake I did.

  • Came across this few years back, caused some strange behaviour and took some effort to find the cause. Workaround was to call T-SQL GETDATE() once at the start of the Master Package.

    😎

  • I use a VB.net script task to set the date:

    Dts.Variables("BatchDate").Value = date.Now()

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

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