Reputation: 9
I want to import data from Excel into corresponding tables based on different column data's on based on ID's like customer data on based on CustomerID
present in Customer
table.
Means we have to extract data from the table and Excel source on basis of ID's.
Could you please help me out on this?
Upvotes: 0
Views: 333
Reputation: 754628
Use the SQL Server Data Import Wizard - see an article on it here.
(source: databasedesign-resource.com)
This wizard allows you to define your Excel file to import, it allows you to define the target where to put the data, it allows you to define mappings between columns in Excel and columns in your SQL table, and much more.
Update: based on your comment to the other answer, if you need to import the Excel sheet and match it up to some pre-existing lookup data, then you should definitely look at the SQL Server Integration Services (SSIS) which are there exactly for this kind of import/lookup scenario.
Upvotes: 1
Reputation: 10563
Your question's gamma is a bit all over the place so not entirely sure what you are asking about but here goes.
You can save you excel spreadsheet as a CSV file and then import that into your database. There a number of tutorials on this if you search google. Try searching "import CSV into database".
Upvotes: 0