Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Sep 16, 2010 05:23 AM by suresh dasari
Sep 24, 2007 10:55 AM|LINK
Sep 24, 2007 03:13 PM|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 03:31 PM|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 10:18 PM|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 03:13 PM|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 26, 2008 11:01 PM|LINK
May 08, 2008 10:58 AM|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 02:04 AM|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 05:23 AM|LINK
Here is the link which is helpful for your requirement