Last post Sep 16, 2010 06:23 AM by suresh dasari
Sep 24, 2007 11:55 AM|Hisham Alsayed|LINK
Sep 24, 2007 04:13 PM|PardeepBogra|LINK
Your query is not clear.. you wish to copy data from Excel to SQL Server Express or You wish to read Excel data from ASP.Net application:
If you want to know, how to read Excel data in ASP.Net Application, visit the follocing web link:
reading Excel files
Sep 24, 2007 04:31 PM|dstpierre|LINK
You may try this SQL fonction OPENROWSET, suppose you have an Excel file in the C:\ drive of the SQL Server database, and the data is on a Worksheet called Sheet1 and your two columns are called Column1 and Column2.
INSERT INTO MyTable
SELECT Column1, Column2FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:\MyTable.xls', 'SELECT * FROM [Sheet1$]')
The first row of your Excel file should coutains the colums names.
Hope this answer your question.
Sep 24, 2007 11:18 PM|Hisham Alsayed|LINK
hi, exactly i would like to copy two columns of data from Excel file instead of two columns of data in sql express,thank u
Jan 08, 2008 04:13 PM|usimsek|LINK
I was looking for the same answer and i achieved that using a script like below :
But, you must provide mytable with machin coloumns
and Ad Hoc Distributed Queries must be
Apr 27, 2008 12:01 AM|tech99|LINK
May 08, 2008 11:58 AM|usimsek|LINK
Yes. I saw that error message when i was trying to read from my pc while the SQL server was another server. I solved that problem copying the file to the server... Or maybe you can show the full path considering the network path.
Sep 01, 2008 03:04 AM|aquilegia|LINK
doubt this will be current for you anymore, but might help someone in future. I'm using SQL Server Express 2005 - I needed to alter some advanced options in order to run the statement. See below (first statement shows all possible options).
SELECT * FROM sys.configurations
ORDER BY name ;
sp_configure 'show advanced options', 1;GORECONFIGURE;GO
sp_configure 'Ad Hoc Distributed Queries', 1;GORECONFIGURE;GO
Sep 16, 2010 06:23 AM|suresh dasari|LINK
Here is the link which is helpful for your requirement