Click here to Skip to main content
13,090,299 members (86,846 online)
Rate this:
Please Sign up or sign in to vote.
See more:
i have created the excel that sheet columns as follows;

Name DOB Mobileno Weddingday Email Active

100 of records are there in Excel.

i want to export that excel records into sqlserver 2005 table(DataBase)

Database columns as follows.

Name DOB Mobileno Weddingday Eamil Active

Table name as BirthDayWish.

Through query how to export the excel data in to sqlserver 2005 BirthDayWish table(Database).

it is possible by using query the excel data is export from excel to BirthDayWish Table.

plese help me.
Posted 31-Dec-12 19:30pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

This link can help you out what you are looking for:[^]
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Here you go

INSERT INTO [BirthDayWish] 
SELECT [Name],[DOB],[Mobileno],[Weddingday],[Email],[Active] FROM OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0;Database=<excel file full path>', [<excel sheetname="">$])

In the above query it is assumed that you are passing an excel file in office 2003 format(.xls). ExcelSheetName is the worksheet name (e.g. say Sheet1) in your excel workbook.

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

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web04 | 2.8.170813.1 | Last Updated 1 Jan 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100