views:

102

answers:

3

I would like to copy (publish for MsAccess users) some tables from sqlserver 2K to an MsAccessDatabase. Is this possible in TSQL?

If not, as an alternative, is it possible to call DTS-packages from the command-line?

UPDATE : tx to the answer of John Sansom I explored DTSrun, and it works just fine. This update for the syntax :

dtsrun /S[serverName] /N[packageName] /EMicrosoft OLE DB Provider for SQL Server
+1  A: 

Two questions for the price of one eh.

For question 1: I am not certain if this can be achieved using only pure T-SQL. You may be able to achieve the same end goal however via the use of either Linked Servers or SQL Server Replication to Heterogeneous data sources.

For questions 2:

You can indeed run a DTS package from the command line. Take a look at the dtsrun utility.

dtsrun utility

John Sansom
tx, I give it a look
Peter
@Peter: You're welcome. I've also added some avenues of exploration for question 1.
John Sansom
+2  A: 

It's been a long, long time since I touched MS Access, but from distant (mostly suppressed) memory I recall there was a way to create linked (external) tables to any ODBC supplier including SQL Server.

This worked the same way as for linking to tables in another MS Access database.

It gives you a live connection to the external tables, which might suit you better than periodic copies.

Update: sounds like you need snapshots of data... in which case attached tables can still work, just that you copy the data from those attached tables to your snapshot tables as often as you want to - thus controlling the frequency of update with the added benefit of having live data on demand.

Ed Guiness
:-)) "from distant (mostly suppressed) memory" , but anyway, no I really want clean publications, tx
Peter
snapshots indeed, but the number of tables for publishing can vary
Peter
A: 

You are best of using SSIS (the new name for DTS)

To run a package from the command line you can use dtexec

Shiraz Bhaiji
Tx, But this was about sqlserver2k
Peter