SQL Server Performance

*****URGENT***** Help needed in importing Data From Excel file to SQL Server 2000 database

Discussion in 'SQL Server DTS-Related Questions' started by rohit2900, Dec 12, 2007.

  1. rohit2900 Member

    Hi,
    I'm having an excel file with around 50 columns and I want to write a DTS package which should create a table in the database and import the data from excel file to that table for the first time and after that it should append the records whenever it is run by the user.
    FYI: The number of columns and their order will be same everytime and I'll be run on an weekly basis to import the data in the database.
    Please help me in doing this...!
    Thanks in Advance.
    Rohit
  2. Adriaan New Member

    If you already know the columns, then just create the table, and let the job do the insert.
    Otherwise, check IF OBJECT_ID('table_name') IS NULL to determine that the table does not yet exist. Within that IF, include the CREATE TABLE syntax as required (if you want to do it properly, or use SELECT ... INTO ... if you want the easy way out).
    After the IF, you put your INSERT statement. Not sure how this is implemented in DTS.
    On a side-note, please choose neutral titles for your questions. You run the risk of getting ignored with all that urgency.
  3. rohit2900 Member

    Thanks a lot Adriaan for your time and replying my post.....I'm able to do this through DTS.....
    Thank You,
    Rohit

Share This Page