SQL 2012 file processing from Access

  • Got a quick question, Is there a way to count the columns in an access table before process it and inserting that data into a SQL table?

  • cbrammer1219 - Wednesday, September 13, 2017 2:29 PM

    Got a quick question, Is there a way to count the columns in an access table before process it and inserting that data into a SQL table?

    I have some C# which enumerates the columns in an  Access table. Is that of any interest?

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • I'm thinking the ACE drivers might let you do such a thing directly.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Jeff Moden - Wednesday, September 13, 2017 4:44 PM

    I'm thinking the ACE drivers might let you do such a thing directly.

    I do use the ACE drivers to connect to Access DBs from C#, but 'directly' is an overly generous description of the way in which columns in a specific named table can be analysed. At least that's true of my method; no doubt there are better ways out there.

    If you haven't even tried to resolve your issue, please don't expect the hard-working volunteers here to waste their time providing links to answers which you could easily have found yourself.

  • If you're doing it from within SSIS, I'd do what Phil said... if you're reading from Access, then you can do this:
    DBEngine(0)(0).Tabledefs("TableName").Columns.Count  will work if you're reading from the current database inside Access.

Viewing 5 posts - 1 through 4 (of 4 total)

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