August 27, 2008 at 12:00 pm
does anyone have a working example of loading from an excel file where the column count will not be the same on each import? I need to load such a file into a staging table routinely and am not familiar with creating custom components. in my scenario its fine to drop and recreate the table on each import if neccessary.
August 27, 2008 at 12:29 pm
Is it possible for you to use an INSERT INTO statement? From BOL:
The SELECT INTO statement creates a new table and populates it with the result set of the SELECT statement. SELECT INTO can be used to combine data from several tables or views into one table. It can also be used to create a new table that contains data selected from a linked server.
August 27, 2008 at 12:32 pm
whatever will work...however, using insert into requires me to know what columns are 'in coming'. I will not know this. Is there something in your suggestion i am missing? thx for the reply
August 27, 2008 at 12:34 pm
i just re-read your post...The select into would work...but the data is coming from excel.. its not yet in SQL server... so im thinking i need to import it first before i could do the select into...no?
August 27, 2008 at 12:40 pm
If your Excel files are available in CSV format (in which an Excel file consisting of a single work sheet can be saved) then look at this forum posting (made today)
http://www.sqlservercentral.com/Forums/Topic559811-149-1.aspx#bm559856
hopefully this might point you in the direction you want to go
August 27, 2008 at 8:35 pm
BitBucket...that worked great!.. very good workaround...quick to implement. Still want to get a good handle on the DTS design/runtime object model though...but for now...this will keep me going...thanks again very much. 😀
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply