September 11, 2008 at 3:41 pm
I'm building a SSIS package to extract data from an AS400 system and import into SQL. The actual transfer runs fine, but the tables, as configured in the AS400 have cryptic column names. Luckily, the AS400 programmer has put in usefull column descriptions. I do not want to manually rename all the column names once I build the tables in SQL. Ultimately, I would like to find a way to pull all the column descriptions from the AS400 and incorporate them into a script to build the corresponding tables in SQL.
I know very little about AS400's, so I'm taking the approach of developing a .Net application that will connect to the AS400 via the IBM iSeries OLE DB drivers (or the Microsoft driver), and then pull the column descriptions out from the AS400's metadata. However, I'm having trouble getting started.
I would appreciate any assistance in this endeavor if anyone has some insight. Thanks.
September 12, 2008 at 6:51 am
Drew,
Here is a query I use to get this data in a .NET app:
[font="Courier New"]SELECT
COLUMN_NAME AS Name,
COLUMN_TEXT AS Description,
DATA_TYPE AS TYPE,
LENGTH AS Length,
NUMERIC_SCALE AS Scale,
NUMERIC_PRECISION AS PRECISION,
IS_NULLABLE AS Nullable
FROM
QSYS2.SYSCOLUMNS
WHERE
TABLE_SCHEMA = ? AND
TABLE_NAME = ?[/font]
Jack Corbett
Consultant - Straight Path Solutions
Check out these links on how to get faster and more accurate answers:
Forum Etiquette: How to post data/code on a forum to get the best help
Need an Answer? Actually, No ... You Need a Question
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply