Results 1 to 2 of 2
  1. #1
    Join Date
    Feb 2004
    Posts
    5

    Unanswered: DTS: excel to sql server

    I posted this earlier, but it did not seem to get any views. Please help!

    I'm trying to import an excel spreadsheet into SQL Server. I keep getting an error saying that 2 columns cannot except NULL values. Here's the setup of each file.

    SQL TBL:
    My table has 9 columns. the first column is a Primary Key and IDENTITY(1,1). My last column is a dateCreated column with a default of getDate(). Both values are set to NOT NULL. The 7 inside columns are just plain varChar datatypes.

    XLS:
    My spreadsheet has 7 columns which corelate to the 7 inside columns of my SQL TBL. I do not want to specify my first and last columns because they should be unique to the SQL TBL (identity and getDate()).

    Any help with how to do this would be great. If you need more info, please let me know.

    Thanks,
    Tim

  2. #2
    Join Date
    Jan 2004
    Location
    Bermuda
    Posts
    40
    Tim:

    If this table is already full of data, edit the DTS package Transformation properties to NOT Copy to EITHER your PK or Date field.

    Otherwise, if the table's empty, drop the PK & Date fields for the initial import THEN re-add them back.

    Hope this helps

    RobbieD
    Sunny Times...

Posting Permissions

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