importing from access to SQL Server

lional

Well-known member
Joined
Nov 29, 2018
Messages
59
Programming Experience
Beginner
Hi All
The next stage of my college app.
I need to export data from an old access database, into SQL Server that my app uses
The data needs to be manipulated because it does not conform and the fields in the new database has changed.

What is the best method. I was thinking of reading data from Access, assigning the fields to a variable, manipulating it and then writing each record back to SQL Server.

It does seem long winded but the only way I know seen as I am new to C#.

I know how to write it back to SQL in C# but I must still figure out how to retrieve the data from access and assign it to variables.

is there a better method.
 
Hey, Thanks for Posting. Here are steps to import an access database to SQL server.

  1. Open SQL Server
  2. Right click on the database folder/node to import
  3. Click on All tasks
  4. Click on Import Data
  5. The Data Transfer Services Wizard screen will appear.
  6. Click on Next
  7. The Choose a Data Source screen will appear.
  8. In the Data Source field, choose Microsoft Access.
  9. In the file name field, enter C:\taxrates\general.mdb.
  10. NOTE: Enter the name of the database you are importing: C:\taxrates\states.mdb and C:\taxrates\stateszip4.mdb
  11. Click on Next.
  12. The Choose a destination screen will appear.
  13. The destination should be Microsoft OLE DB Provider for SQL Server. The Server should be the name of your SQL Server. It will not be Jerry.
  14. Click on Use Windows Authentication if a password is not required. If a password is required, click on Use SQL Server Authentication and enter your username and password.
  15. At the database field, using the drop down menu, choose New.
  16. A Create Database dialog box will appear as shown below.
  17. In the Name field, enter the name of the Access data base that is being imported to the SQL Server. Do not change the default data file or log file sizes.
    • NOTE: Be sure to spell the database name in the SQL Server with the exact same name as the MS Access database name. This is necessary to create the new folder.
  18. Click on OK.
  19. Click on Next.
  20. The Specify Table Copy or Query screen will appear.
  21. Choose Copy table(s) and view(s) from the source database.
  22. Click on Next.
  23. The Select Source Tables and Views screen will appear. It will look different for SQL Server 2005.
  24. Select the top two tables: Accum and Exempt. When you follow these steps later for the states and stateszip4 databases, Click Select All.
  25. Click on Next.
  26. The Save, schedule, and replicate package screen will appear.
  27. In the When box, make sure the Run immediately choice is checked. Don’t click on anything else on this screen at this time.
  28. Click on Next.
  29. The Completing the DTS Import/Export Wizard will appear.
  30. Click on Finish.
  31. You should see an Executing Package screen which shows the progress of the importing of data from Access to the SQL Server as shown above.
  32. You should see a screen with the Successfully copied 2 table(s) message.
  33. Click on OK.
  34. Click on Done.
Hope this helps you.
 
Back
Top Bottom