Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Handle data between 2 Access databases using T-SQL

Author  Topic 

SQLMark
Starting Member

18 Posts

Posted - 2009-06-08 : 11:10:56
Hi all
I have two Access database and I want to move data from one to the other one using some customer rules..
So it is not a simple 1:1 data moving but informations need to be processed.
If the request was to transfer data between two SQL database, I could use stored procedure ... but in this case how can I transfer data between Access db working inside a SQL stored procedure?

I know that I could read data from Access using OPENROWSET as follow:

INSERT INTO DestinationTable
( field1, field2, ... )
SELECT field1, field2, ...
FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0',
'C:\myAccessDbFile.mdb';'admin';'', 'SELECT * FROM SourceTable')


where "DestinationTable" could be a temporary SQL table, but what is the query for insert data into the Access db?
As far as I know, the SQL Server "INSERT" statement works only with SQL Server tables...

I would like avoid to
1. convert the 2 databases in SQL Server format
2. execute the stored procedure that change data (in SQL, of course...)
3. execute the SQL Server "Export/Import" tool for transfer data from SQL to Access

and I would like also avoid to learn Microsoft Access for handle data (...there is no time and I have little will to learn it!).

Any ideas?
   

- Advertisement -