views:

690

answers:

1

I am trying come up with a way to pull the tables out of an Access database, automate the creation of those same tables in a SQL 2008 DB, and move the data to the new tables. This process will happen on a regular basis and there may be different tables each time.

I would like to do this totally in SSIS.

C# SQL CLR objects are an option.

The main issue I have been running into is how to get the Access table's schema and then convert that to a SQL script that I can run via SSIS.

Any ideas?

TIA J

+1  A: 

SSIS cannot adapt to new tables at runtime. (You can change connections, move a source to a table with a different name, but the same schema) So, it's not really easy to do what I think you are saying: Upsize an arbitrary set of tables in an Access DB to SQL (mirroring their structure and data, naming, etc), so that I can then write some straight SQL to transform the data into another SQL database or the same part of the database.

You can access the SSIS object model from C# and build a package (or modify a template package) programmatically and then execute it. This might offer the best bang for your buck, but the SSIS object model is kind of deep. The SSIS Team blog have finally started putting up examples (a year after I had to figure a lot of this out for myself)

There is always the upsizing wizard, and I'm sure there are some third party tools.

Cade Roux