Hi All
Using the really good code here, to get excel data in to SQL table:
http://weblogs.asp.net/mikebosch/archive/2007/10/26/ssis-skipping-rows-and-stripping-subtotals.aspx
This works fine .... but I am trying to get a id column in with the insert
Dim command As New OleDbCommand("select * from [" & excelTables(i).ToString() & "A:AL]", excelConnection)
Change the above line to line below. (Note fk_idnumber is not a column from excel)
Dim command As New OleDbCommand("select 1 as fk_idnumber, * from [" & excelTables(i).ToString() & "A:AL]", excelConnection)
Dim rdr As OleDbDataReader = command.ExecuteReader
Dim BulkCopy As New SqlBulkCopy(dbconnection)
BulkCopy.DestinationTableName = "stg_bookon"
BulkCopy.WriteToServer(rdr)
Interestingly this doesnt break ..... but nothing is inserted. It seems only data from the * (Excel columns) is included
Any ideas how this can be don?
Thanks
BiF