Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
Log in  ::  Register  ::  Not logged in

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Set logging properties for group of DTS packages

By philcart,

This script will set the Logging properties for a group of DTS packages.

To run this script stand-alone, you'll need to set 6 variables. sSvr, sDb, sUid, sPwd, iSec and sPkgMatch. If you use this script in a DTS package, you can assign the values from Global Variables.

The sPkgMatch variable is used as a filter criteria on the package name when selecting records from msdb..sysdtspackages. If nothing is specified for this variable, all packages will be selected.

EXAMPLE: sPkgName = "Devel", will change all packages with a name that starts with 'Devel'.

Once it has the list of package names, it opens the package using the LoadFromSQLServer method, sets the Logging properties and saves the package.

NOTE: As the package is being modified programmatically, you will lose any text annotations and layout previously applied. Unfortunately there is no way to modify the package outside the DTS Designer and maintain these items.

Questions and comments welcome.


Total article views: 406 | Views in the last 30 days: 1
Related Articles

Variable not in script task

Package level variable not in dts.variables in script


How to replace a local Variable in SSIS package by Variable declared in Configuration Package?

How to replace a local Variable in SSIS package by Variable declared in Configuration Package?


How & where do you write to a Variable that has scope the entire Package?

Package Variable similar to Global Variable in DTS


Report Progress with Variables

Script task in my package's OnProgress event handler reports all variable values at each step.


Controlling Package execution using script task

Controlling Package execution using script task


Join the most active online SQL Server Community

SQL knowledge, delivered daily, free:

Email address:  

You make SSC a better place

As a member of SQLServerCentral, you get free access to loads of fresh content: thousands of articles and SQL scripts, a library of free eBooks, a weekly database news roundup, a great Q & A platform… And it’s our huge, buzzing community of SQL Server Professionals that makes it such a success.

Join us!

Steve Jones

Already a member? Jump in:

Email address:   Password:   Remember me: Forgotten your password?
Steve Jones