Question

I am reading a spreadsheet which is having 2400 rows. I want to insert all these records to a SQL server table. My client does not want to use bulk insert. Where as batch insert only allows 1000 records at a time.

Anyone please suggest how can I do this?

Was it helpful?

Solution

sp_configure 'show advanced options', 1;
RECONFIGURE;
sp_configure 'Ad Hoc Distributed Queries', 1;
RECONFIGURE;
GO   


 Insert into [TABLE]
        select * FROM OPENDATASOURCE('Microsoft.Jet.OLEDB.4.0',
        'Data Source=C:\test.xls;Extended Properties=Excel 8.0')...[Sheat1$]
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top