Loading Data From Excel

  • I work on a data warehouse that loads lots of static (config) data from Excel spreadsheets using DTS. The developers have implementated a little text file with a rowcount for each Excel Worksheet so that DTS doesn't load lots of blank rows but just up to the row limit set in the rowcount file.

    This seems very clumsy to me and obviously there is potential for the Excel file and the rowcount file to fall out of step. I was wondering if there's a better way.

    Please don't suggest loading everything and then deleting the null rows as that seems just as clumsy. Nor does putting the rowcount in a separate worksheet seem any better.

    Thanks!

  • You can query the spreadsheet as if it were a table and use a Where statement in that. "Where [col 1] is not null" should do the trick for you. Just look into using a query instead of a full table copy. Books Online has the data on how to do that.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

  • As an aside, this is the T-SQL 2005 forum. Your question might fit better in either the SQL 2000 DTS forum (since you say it's DTS), or the SQL 2005 SSIS forum (if that's what you meant).

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply