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 2008 Forums
 SSIS and Import/Export (2008)
 Reading Access Sources to One Target SQL Table

Author  Topic 

aakcse
Aged Yak Warrior

570 Posts

Posted - 2014-06-04 : 15:26:56
Say I have 'n' access db files and I want to load all of them to one table in SQL Server say 'SQLTab'

First.accdb -> has AA table Name < Should be loaded to > SQLTab in sqlserver
Second.accdb -> has BB table Name < Should be loaded to > SQLTab in sqlserver
..
..
..

AA , BB ... has the similar structure and target table 'SQLTab' also has the same structure.



-Neil

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-06-04 : 15:30:18
I think SSIS can easily handle this task, but I believe Access also can, though I have no experience with Access.

Try creating an SSIS package and have the destination be the SQLTab table for all of the imports.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2014-06-04 : 15:33:47
I need to know how to capture the table name in variable and point it to target

First need to loop through all the access db files, pick up one at a time and get the table name init ( there is only one table in each access file) and push that table content to target SQL Server table and loop through others

-Neil
Go to Top of Page

aakcse
Aged Yak Warrior

570 Posts

Posted - 2014-06-05 : 02:46:48
Got this, by using the for each loop file variable and used derived column to capture this file name and loaded it into destination.

however the file name is not fully qualified it is not getting the extension part of the file name

eg. abc.accdb

it is taking only abc and not .accdb



-Neil
Go to Top of Page
   

- Advertisement -