S2K DTS and Python

Tim Golden mail at timgolden.me.uk
Tue Jul 10 03:57:49 EDT 2007


Phil Runciman wrote:
> I am a Python newbie so please be gentle on me.

Welcome to Python.

> I have created a program that takes text files within a directory and it
> successfully parses the information from them to create 3 CSV files.

Good so far.

> However, I now want to update some tables in MSAccess, and it occurred
> to me that because Sequel Server 2000 DTS can interface with scripting
> languages that maybe I could call my first Python program from within
> DTS and then update the tables using DTS. (I am learning DTS hence the
> idea).

Unless you *really* wanted to learn DTS (and I don't find it
that useful myself) then simply do this through Python... and
have some fun at the same time :)

> My questions are:
> 
> Has anyone used Python within DTS?

Haven't, but I wouldn't even try. Unless I were constrained
by some kind of contractual binding, I wouldn't even *start*
using DTS if I could use Python. I find it far too opaque.

> Am I off the wall trying such a thing?

No, but I think it's easier to use the csv module, pyodbc [1]
and either code the SQL directly, which is what I tend to do, or
use one of the several SQL-ORM-style wrappers around: SQLObject[2],
sqlalchemy[3] and its friend Elixir[4], or the newly-advertised
Storm[5] from Canonical.

Feel free to post back with questions or progress.

TJG

[1] http://pyodbc.sf.net
[2] http://www.sqlobject.org/
[3] http://sqlalchemy.org
[4] http://elixir.ematia.de/
[5] https://storm.canonical.com/



More information about the Python-list mailing list