Hi Azarc3,
Thanks for your code.
This would work for if the exel sheet has three columns.
But if the excel sheet has only 2 columns then it gives an error at this line
destinationConnection.Open
Any suggestion how we can dynamically support the select to select for 2 columns or 3 columns. Say the maximum columns the table would support is 4.
Is there anyway we can know the column names & number of colums in the excel sheet by ("SELECT * From [Sheet1$]", excelConnection)
The same column name(s) in the excel sheet and dbo.tablename will be maintained.
Kindly advise
Main Topics
Browse All Topics





by: azarc3Posted on 2009-10-14 at 12:52:13ID: 25574406
Here's my suggestion...
Select allOpen in new window