Join txt file with sql table

  • I am needing to create a sql statement that will allow me to create a join between a text file and a sql table. The txt file is fixed length. They will be joined by a common char field, SSN.

    How to I create a sub-query for an external database like this. Also, does anyone know how I would set up the column layout for the fixed length file?

    Any help is greatly appreciated.

    thanks,

    Cammy

  • Import the text file into SQL Server using DTS, then join on the newly created table onto the regular SQL table using standard join syntax.

    Column layout for fixed length field should be figured out through a DTS import, but generally you will have CHAR(n) datatypes, where "n" is the length of your mainframe data field.

    Keep in mind, however, that the maximum row size for any table row is around 8000 ASCII characters, and 4000 Unicode. Do be careful when bringing over hefty AS/400 files.

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

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