January 5, 2010 at 9:09 am
Tried the following to export some data to excel:
INSERT INTO OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel 8.0;Database=C:test.xls', 'SELECT * FROM [Sheet1$]')
SELECT * FROM Test_Info
I get this error error:
Msg 213, Level 16, State 1, Line 8
Insert Error: Column name or number of supplied values does not match table definition.
The excel is blank, is this error because there are no column names in the execl?
Is there a way to put the cloumn name in the spreadsheet dynamicly?
Thanks
January 5, 2010 at 9:46 am
May I suggest reading the following
http://www.simple-talk.com/sql/t-sql-programming/sql-server-excel-workbench/
It has all that you want to know about interfacing with EXCEL and more, great sample code.
January 5, 2010 at 11:10 am
Thanks, I think that I can find what I need here. This is a very comprehensive article!
Good Stuff
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply