Click here to Skip to main content
15,886,199 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have MST_CUSTOMERS table containing multiple columns. Now I want to import the data from MST_CUSTOMERS table to SQL database. The problem is MST_CUSTOMER table contains data of customer, instructor, car, job details, etc. And I want to move/copy data in specific tables in SQL. For e.g. customer's data should move in Customer table in SQL, instructor's data should move/copy in Instructor table in SQL, car's data should move/copy in Car table, and job details should move/copy in JOB_DETAILS table in SQL.
How can I do that??? Please help me.

What I have tried:

Can anyone solve this?? Please help me. I didn't understand what to do.
Posted
Updated 21-Sep-18 0:48am
v2

You've got few ways to resolve your issue.
A. download and install Microsoft SQL Server Migration Assistant 7.10 for Access[^]; Then follow the steps of wizard;
B. you can use BULK command[^]
C. you can use SQLBulkCopy class[^]; It's quite easy:
  1. Connect to MS Access database
  2. Create command to get corresponding data
  3. Load data into DataTable
  4. Close connection to MS Access database
  5. Connect to MS SQL Server
  6. Copy data from datatable to proper MS SQL Server table
  7. Close connection to MS SQL Server

That's all!
 
Share this answer
 
Comments
Chand333 21-Sep-18 7:04am    
But the MST_CUSTOMER table is in access database and I want to import it's data in SQL database tables. Can I do it using this.
Maciej Los 21-Sep-18 7:07am    
Yes, you can.
Chand333 21-Sep-18 7:17am    
Ok. Thank You
Maciej Los 21-Sep-18 7:22am    
You're very welcome.
Chand333 21-Sep-18 8:39am    
Now the question left is how I will get to know which column of MST_CUSTOMER table should be copy in which table. Please help me.
I would go for an ETL like SSIS, for example.
You provided so few informations that it is practically all that can be answered at that point.
 
Share this answer
 
Comments
Maciej Los 21-Sep-18 6:59am    
I forgot about SSIS, but i did provide bit more information. 4!
Now, our answers turns into complete solution ;)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900