all groups > sql server dts > december 2003 >
You're in the

sql server dts

group:

Batch file that runs a package


Batch file that runs a package Mary
12/12/2003 3:22:26 PM
sql server dts:
SQL Server 2000

Have created a batch file on my local Win2k workstation
that calls another batch file from SQL Server.

WORKSTATION BATCH FILE:

REM Calls HR03 batch file on SQL Server
pushd \\erpimgdev1\DTS_Info
CD batch
CALL Start_HR03_ZW1_Job.bat

This successfully calls the second batch file on the SQL
Server.

However, when the second batch file runs, it errors out
after DTSRun kicks off.

SQL SERVER BATCH FILE:
Note, user account and password not shown)

REM Starts package HR03_ZW1
CD..
CD SQL_Binn
DTSRun.exe /S "ERPIMGDEV1" /U "Domain\SQLAccount" /P "Passw
ord" /N "Start_HR03_ZW1_Job" /G "{CDE19F0E-F40D-422H-9BBB-
3B4B22FA66L9}" /L "D:\DTS_Info\Logs\Start_HR03_ZW1_Job.txt"
/W "-1" /E

ERROR AS DISPLAYED IN THE COMMAND PROMPT SCREEN:
(Note, user account and password not shown)

S:\SQL_Binn>DTSRun.exe /S "ERPIMGDEV1" /U "Domain\SQLAccoun
t" /P "Password" /N "Start_HR03_ZW1_Job" /G "{CDE19F0E-
F40D-422H-9BBB
3B4B22FA66L9}" /L "D:\DTS_Info\Logs\Start_HR03_ZW1_Job.txt"
/W "-1" /E
DTSRun: Loading...
DTSRun: Executing...
DTSRun OnStart: DTSStep_DTSExecuteSQLTask_1
DTSRun OnError: DTSStep_DTSExecuteSQLTask_1, Error = -
2147286789 (800300FB)
Error string: The file is not a valid compound file.
Error source: Microsoft OLE DB Service Components
Help file:
Help context: 0

Error Detail Records:

Error: -2147286789 (800300FB); Provider Error: 0 (0)
Error string: The file is not a valid compound file.
Error source: Microsoft OLE DB Service Components
Help file:
Help context: 0

DTSRun OnFinish: DTSStep_DTSExecuteSQLTask_1
DTSRun: Package execution complete.

Now, if I log onto SQL Server using the same
DomainName/SQLAccount /P "Password" as what's in my DTSRun
line, and then kick off only the server batch file from
the server desktop , it works just fine, no errors.

Appears to be a permissions issue if I'm on the right
track at all... but I could use some guru help in
understanding the problem.

Thanks,

Mary


Re: Batch file that runs a package Darren Green
12/16/2003 1:22:47 PM
In article <052001c3c106$ce14f3b0$a101280a@phx.gbl>, Mary
<Mary_Scheffler@urscorp.com> writes
[quoted text, click to view]

You mention testing this by "..I log onto SQL Server using..", but this
is not a valid test since the package is still executing on the
workstation.

Do you expect the package to run on the workstation correctly?

The use of /U and /P for DTSRUN should be fro SQL Server security only
so using domain\account does not make sense. I suspect the reason why it
works if because you have also supplied /E to use integrated security.
The /U/P and /E options are mutually exclusive, although this is
obviously not enforced at a command syntax level.

The credentials supplied to DTSRUN are use to load the connect to SQL
Server to load a package only. They have no influence on the execution
context of the package itself. The package will still be executing under
the context of the logged on user calling the batch file.

Can you use DTSRUN directly on the workstation to execute the package
successfully? This would be the best test of the security issues here.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
AddThis Social Bookmark Button