Welcome to EMC Consulting Blogs Sign in | Join | Help

SSIS Junkie

Once upon a time this blog was a hive of activity. Now however its pretty lifeless as you can probably tell so if are pining for more of the same you can find me over at http://sqlblog.com/blogs/jamie_thomson. I look forward to seeing you there!

SSIS: Dynamically set a checkpoint file location

Someone recently asked me if it was possible to dynamically set the location of a checkpoint file. Happily the answer is yes and in actual fact its something that I do all the time so that my packages can all work in conjunction with my Common Folder Structure. Of course, its all achieved with that most venerable of SSIS features, property expressions.

So here's an idea you might like to implement. It builds the location of a checkpoint file dynamically based on the package name. I have 2 variables:

 

The variable @[User::RootLocation] would typically be set when the package is executed either by a parent package configuration, the /SET option of dtexec.exe or by a configuration.The variable @[User::CheckpointFile] is set dynamically using an expression that includes the name of the package. You can see that expression here:

Once you've got those 2 variables in place setting the location of the checkpoint file is very easy. You simply need to put an expression on the CheckpointFileName property of the package:

 again using an expression like so:

 

That's basically it. All you need to set a checkpoint file name dynamically is property expressions.

-Jamie

Published 15 November 2007 18:52 by jamie.thomson

Comments

 

PedroCGD said:

Dear Jamie,

Supose you server shutdows... How you have the variables values next time you start the package using checkpoint?

Regards!!!

Pedro

February 1, 2008 21:28
 

jamie.thomson said:

Pedro,

The contents of all the variables define the "state" of a package at any one point in time. Variable values are persisted in a checkpoint file, thus state is preserved.

-Jamie

February 2, 2008 01:05
 

Michael Rivera said:

I have migrated some of my packages from 2005 server to a 2008 server and I am getting the following errors with the checkpoint file.

The result of the expression "@[User::LogFolder] +"CheckPoint\\" +@[System::PackageName]" on property "CheckpointFileName" cannot be written to the property. The expression was evaluated, but cannot be set on the property

and

The file name is not valid. The file name is a device or contains invalid characters

These work fine in an SSIS 05 server.

November 20, 2008 21:24
New Comments to this post are disabled

This Blog

Syndication

Powered by Community Server (Personal Edition), by Telligent Systems