Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
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.

Phill

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

Variable not in script task

Package level variable not in dts.variables in script

FORUM

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?

FORUM

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

Package Variable similar to Global Variable in DTS

SCRIPT

Report Progress with Variables

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

FORUM

Controlling Package execution using script task

Controlling Package execution using script task

 
Contribute