0

I have a folder called "Access" which contains 400 various access files. Each of these have the same structure, and 6 tables. I need to import these into Microsoft SQL Server (2014). Due to a lack of detail in the Access databases, I also need to run a normalization script after each import to make sure the relationships in the tables are kept.

I've used the wizard, and it works fine, but if there's a way to automatically import all the files and save me a week of work manually importing it would be much appreciated.

2 Answers 2

1

I've created SSIS packages to do this type of processing. Create a Foreach Loop Container, inside the container create a Data Flow Task that imports the files from the folder specified into your database/tables. Then create a "file system task" that moves the file to a completed folder. This could then be scheduled via sql jobs to run until all the files are processed/imported.

Sign up to request clarification or add additional context in comments.

1 Comment

This is working great! Thanks for the help. Turns out there are lots of exceptions in the access tables so I need to figure those out and then figure out how to run the script after each import
0

Google returned this:

    INSERT INTO [dbo].[#tblImport]
        Field1,Field2,Field3,Field4
    SELECT 
        [Field1],[Field2],[Field3],[Field4] 
    FROM OPENDATASOURCE_
    ('Microsoft.Jet.OLEDB.4.0','C:\My Database.mdb')...[TableName]

Source

2 Comments

Wouldn't this be for only one file at a time, for one table at a time? The wizard can import all tables from a file at once so it is quicker than this
Sorry @kedingt, I have misread the question and thought you were trying to import access tables. You might find some T-SQL scripts out there to import entire databases too.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.