Groups | Blog | Home
all groups > sql server dts > january 2004 >

sql server dts : Environment variables


Spike
1/31/2004 3:44:27 PM
Hi,

What's the best way to have a single point of config for my databasenames? I
use the dynamic property task in all packages to set the UDL path of a
database connection with an environment variable. This works fine when I run
it manually (because I set the variables manually as well), but when I
schedule the package the SQL Agent it can't find the environment variable.

SQL Server Agent runs under a SQLAdmin domain account.

Executed as user: MYDOMAIN\SQLAdmin. ...tus_db.udl C:\WINNT\system32>SET
DWH_UDL_CDWH_DB=c:\datawarehouse\_udl\cdwh_db.udl C:\WINNT\system32>SET
DWH_UDL_CONTROL_DB=c:\datawarehouse\_udl\control_db.udl
C:\WINNT\system32>SET
DWH_UDL_IDS_ARTUS_DB=c:\datawarehouse\_udl\IDS_Artus_db.udlDTSRun:
Loading... DTSRun: Executing... DTSRun OnStart:
DTSStep_DTSCreateProcessTask_4 DTSRun OnFinish:
DTSStep_DTSCreateProcessTask_4 DTSRun OnStart:
DTSStep_DTSExecutePackageTask_1 DTSRun OnError:
DTSStep_DTSExecutePackageTask_1, Error = -2147220489 (800403F7) Error
string: DTSStep_DTSDynamicPropertiesTask_1: Environment variable
'DWH_UDL_CONTROL_DB' not found. Error source: Dynamic Properties Task Help
file: Help context: 0 Error Detail Records: Error: 0 (0); Provider Error: 0
(0) Error string: Environment variable 'DWH_UDL_CONTROL_DB' not found. Error
source: Dynamic Properties Task Help file: ... Process Exit Code 0. The step
succeeded.

Thnx.

Allan Mitchell
1/31/2004 4:58:47 PM
Personally I use one of two methods

1. Ini file. I place the file in a directory I specifically create for the
purpose i.e. c:\DTS\INI\PackageName\Config.ini
2. A database query. I create an alias using cliconfg to a server which
has a database holding a table conatining my configuration information. I
can therefore easily move the packages between environments



--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.allisonmitchell.com - Expert SQL Server Consultancy.
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


[quoted text, click to view]


AddThis Social Bookmark Button