What is the command using for Import and export data from database table using excel file

  • Dear All,

    What is the command using for Import and export data from database table using excel file?

    For example I have a file contains C:\Excel\ xyz.csv which contains xyz table information.

    What is the command for xyz.csv file imported in the database conatins xyz table also what is the command for xyz.csv file exported from database conatins xyz table?

    Please advise me for the needful.

    Thanks in advance.

    Regards

    Sumanta Panda

  • There are three options: BCP, OpenRowSet, and SSIS(or DTS).

    The Import/Export Wizard in SSMS uses SSIS and is a good choice for one time exports or imports. If you need to do this regularly, you should create a package.

    I'm having trouble including sample code, but these articles have good examples of importing and exporting using the above tools:

    http://www.mssqltips.com/tip.asp?tip=1202

    http://www.mssqltips.com/tip.asp?tip=1540

    Greg

  • Why not just use "Get External Data" from Excel?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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