September 13, 2017 at 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?
September 13, 2017 at 4:26 pm
cbrammer1219 - Wednesday, September 13, 2017 2:29 PMGot 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?
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
September 13, 2017 at 4:44 pm
I'm thinking the ACE drivers might let you do such a thing directly.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 13, 2017 at 5:10 pm
Jeff Moden - Wednesday, September 13, 2017 4:44 PMI'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.
The absence of evidence is not evidence of absence
- Martin Rees
The absence of consumable DDL, sample data and desired results is, however, evidence of the absence of my response
- Phil Parkin
September 13, 2017 at 6:37 pm
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