Results 1 to 3 of 3

Thread: DTS selected columns from text file [resolved]

  1. #1

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    Resolved DTS selected columns from text file [resolved]

    Guys

    I need to create a dts package to import a text file into sqlserver. This is fine but the problem I'm having is that the text file contains 4 columns and I only want to import the 3rd column. Again, this is no problem. The problem comes when I want to add an id column to the table. I've checked enable identity insert but it doesn't seem to work.

    Any ideas?!


    Thanks
    Last edited by thebloke; Mar 1st, 2005 at 09:58 AM. Reason: Resolved
    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

  2. #2
    MS SQL Powerposter szlamany's Avatar
    Join Date
    Mar 2004
    Location
    Connecticut
    Posts
    18,263

    Re: DTS selected columns from text file

    I would bulk insert it into a temporary table and then use a stored procedure to re-work it with the extra column and do the final insert.

    Actually, we have a little program called TEXTIMPORT that we keep ripping and customizing to do the odd types of IMPORT's that we need. We probably have 25 versions of it now - all specific to various requirements.

    It also has a .INI file, so that if something simple changes, we can control some aspects of how it imports.

    Got the same thing for output - called TEXTOUTPUT.

    *** Read the sticky in the DB forum about how to get your question answered quickly!! ***

    Please remember to rate posts! Rate any post you find helpful - even in old threads! Use the link to the left - "Rate this Post".

    Some Informative Links:
    [ SQL Rules to Live By ] [ Reserved SQL keywords ] [ When to use INDEX HINTS! ] [ Passing Multi-item Parameters to STORED PROCEDURES ]
    [ Solution to non-domain Windows Authentication ] [ Crazy things we do to shrink log files ] [ SQL 2005 Features ] [ Loading Pictures from DB ]

    MS MVP 2006, 2007, 2008

  3. #3

    Thread Starter
    Hyperactive Member thebloke's Avatar
    Join Date
    May 2003
    Posts
    358

    Resolved Re: DTS selected columns from text file

    Sounds like a good plan to me. Cheers, I'll give it a crack!

    The Bloke
    www.blokeinthekitchen.com
    making cooking cool for blokes

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width