November 2, 2006 at 7:20 am
Hi Folks,
I'm running a simple DTS package by executing a .bat file. The .bat
file does however not terminate. Any ideas?
See my .bat file below:
SET ServerName=<servername>
SET Package=<my dtspackage name>
SET logfile="NewLog.Log"
cls
echo Server is %ServerName%
echo About to run DTS package %Package%
REM --------------------------------------------------------
REM Run the DTS package
REM --------------------------------------------------------
echo Starting DTS package...
echo.
pause
if exist %logfile% del %logfile%
dtsrun /S %ServerName% /E /N %Package% /L %logfile%
if ERRORLEVEL 1 GOTO DTSERR
GOTO DTSOK
TSERR
echo.
echo.
echo An error in %Package% has occurred. Import terminated
GOTO END
TSOK
echo.
echo %Package% run has succeeded.
:END
echo.
echo Batch file ended
pause
November 2, 2006 at 10:24 pm
You do realize that your last command in the bat file is PAUSE, don't you? The last thing in the file is saying to wait, so it is waiting. Take out the PAUSE and add EXIT.
November 3, 2006 at 2:33 am
Thanks for the response.
The batch never made it as far as the pause statement. I've
removed the pause and added exit ... unfortunately, same result.
Regards.
Craig
November 3, 2006 at 3:13 am
How are you executing the bat file? Do you see the command window and are you interacting with it as it runs? I ask because there is another pause command in the middle of the file.
REM --------------------------------------------------------
REM Run the DTS package
REM --------------------------------------------------------
echo Starting DTS package...
echo.
pause
if exist %logfile% del %logfile%
dtsrun /S %ServerName% /E /N %Package% /L %logfile%
November 3, 2006 at 3:31 am
Hi Rob,
At this stage I've yanked everything from the bat file. I literally only have the dtsrun command (with its parameters):
Bat file:
-------------------------------------------------
dtsrun /S<servername> /E /N<packagename> /L "c:\logfile.log" /W True
EXIT
-------------------------------------------------
When I look at the command window, it just scrolls across the screen until I hit Ctrl+C.
(I've even resorted to setting up a test package that just loads a file into a table).
November 3, 2006 at 7:08 am
Does the DTS package runs succesfully when you run it within Enteprise Manager?
Peter Gadsby
Business Intelligence Consultant
www.hgconsult.co.uk
November 3, 2006 at 7:15 am
Does the DTS package runs succesfully when you run it within Enteprise Manager? Yes
November 3, 2006 at 9:17 am
What do the contents of the log file say for the last execute by the bat file?
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply