locked
Import/Export - primary key lost RRS feed

  • Question

  • I'm using the import/export 32 bit util for sql server 2008 r2 and have a copy on my local machine and another on my server.  I export from my local but when I view the primary key on the server and when I view the scripts of the server db, the primary key on the server doesn't have the identity set.

    There's 1 set of tables on my local and 2 on my server.  The Inventory table, for example, has 2 Creates on the server script.  One creates the primary key but is under a different reference (qedsoftw_Admin).  The other is the one my website sees and the primary key is not set.

    For the Admin:CREATE TABLE [qedsoftw_Admin].[Inventory](
     [MfgID] [int] IDENTITY(1,1) NOT NULL,

    What the website sees: CREATE TABLE [dbo].[Inventory](
     [MfgID] [int] NOT NULL,

    Any ideas? and what do I do?

     

    Thanks much,

    DC

    Saturday, April 9, 2011 5:33 PM

Answers

  • Hi

    I know that was such option in old DTS import/export wizard.... But I think you have at leadt tow choices

    1) You might want to consider SQL Compare and SQL Data Compare from Redgate. These tools will help you migrate changes from one environment to another.

    2)To retain constraints in the new database and no need of data, you can use 'Generate Script' available in Sql Server Management Studio.



    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/
    • Proposed as answer by RamJaddu Sunday, April 10, 2011 9:00 AM
    • Marked as answer by Alex Feng (SQL) Sunday, April 17, 2011 3:09 PM
    Sunday, April 10, 2011 7:55 AM