SQL Server Performance

Help with first Excel Data Import to SQL

Discussion in 'ALL SQL SERVER QUESTIONS' started by Michael Parks, Nov 23, 2012.

  1. Michael Parks New Member

    I am running SQL 2008 and have a spreadsheet I want to import into the table dbo.prod_vendor_purch_default

    The table has 3 columns:
    prod_vendor_purch_default_guid (primary key)
    prod_guid
    vendor_guid

    I have the prod_guid and vendor_guid listed in the columns in my excel spreadsheet.

    I need to insert these values into the table while creating a new guid for the prod_vendor_purch_default column for each row.

    I tried using a column in excel that has lower(newid()), but it does not seem to be properly recognized during the import (I get a duplicate record entry-not allowed). So it appears to be attempting to insert the text 'lower(newid())' instead of actually generating a new id.

    Unfortunately I cannot use the bulk import command (I am accessing a remote database and do not have that permission).

    I am connecting to the database using SQL Server Management Studio.

    Any guidance would be much appreciated.
  2. Shehap MVP, MCTS, MCITP SQL Server

    I do believe your Data migration project should be irrelevant to this PK if you are using newid()as a default value for the PK within the Schema design itself of the table ..

    Kindly try it and let me know your feedback

Share This Page