Column Mapping Using Bulk Insert command In tsql.

  • i had small problem with bulk insert command.

    Will Bulk insert command work only when both the Schemas are Exactly matched( i mean whether we need to supply all the columns in the base table or is it ok if we supply some fields.)

    or will bulk insert will allow us to do mapping.

    Thanks

    In advance

    Kishore

  • you need to use a format card if the file isn't the same layout as the table

    For better, quicker answers, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • Thanks Mike.

    Can you give me some example or reference link.

  • See BOL (BooksOnLine, the SQL Server help system), section

    "bcp utility [SQL Server], format files" or section "BULK INSERT (Transact-SQL) "



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • Be prepared for some effort: format files are a BEAR to get working, esp. the first time you try to use them.

    The good thing is, once you get the format file right, they work great.

    Scott Pletcher, SQL Server MVP 2008-2010

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

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