tags:

views:

23

answers:

2

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 master table Means we have to extract data from master table and excel source on basis of ID's

Could you please help me out on this?

A: 

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".

Martin
Hi Martin,I mean that i have one excel data sheet and some master table. On the basis of these i will import data in different tables like customer related data in customer table etc.So in this we shall take a reference from master table to pull data from excel data on basis of primary key like customer ID.
Vijay Sharma
What database are you working with?
Martin
A: 

Use the SQL Server Data Import Wizard - see an article on it here.

alt text

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.

marc_s