DTS import from excel

  • i am trying to import data from MSExcel to SQL 7.0 database. i have to import data from one spread sheet to different tables in a database having foreign keys etc. How do i do it? suggestions please 🙂

  • Start by bringing the Excel file into a temp table and then use T-SQL to pass it into the other tables. DTS will do a great job of bringing the data in from Excel in a consistent format for you if this process needs to be repeated on a regular basis. If this is a one time deal, just right click in the database you wish to bring the data into, select import and go through the wizard. Should be pretty smooth.

    If you require further assistance with the move from the temp table to your live tables, please post specifics and someone will definitely help out.

    Can also provide more specifics on DTS if you would like.

    Hope this helps.

    David

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • thank you, i am going for creating a package in DTS but the only thing that worries me is data integrity, how do i insert records into 3 tables at the same time for the same person and have data integrity. NOTE :customer number is auto generated (primary key)and then its used as a foreign key in the other 2 tables.:(

  • You can't insert records into 3 tables at the same time and have data integrity.But in the same dts package you could insert first into 1 table and then into the other two.

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

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