Can SQL Server DTS batch execute with Python script?

I currently have a few Python scripts to help prepare the staging area for testing. One thing the scripts don't handle is the execution of DTS packages on MS SQL Server. Is there a way to execute these packages using Python?

+2


source to share


2 answers


The answer is yes. As lansinwd mentioned, you want to use the DTSRun command line tool . SQL Server Tools must be installed on the machine running the Python script. I'm not sure what percentage or what packages will be needed, but the MSDN page on DTSRun should help answer this if needed.

Basic command line example:

DTSRun /S "Server[\Instance]" /N "DTS_Package_Name" /E

      



The start is from the Python : http://docs.python.org/library/os.html#process-management

On the web page:

These functions can be used to create and manage processes.

Various exec * () functions take an argument list for a new program loaded into the process

+1


source


Calls DTS from the command line. If so, here's an example.



http://www.mssqltips.com/tip.asp?tip=1007

+1


source







All Articles