Home Forums SQL Server 2005 Administering Export option (right click in the database - tasks - export data...) RE: Export option (right click in the database - tasks - export data...)

  • river1 (3/18/2010)


    No, the identity does not need to retain the same values. I just need to recreate the whole table (primary key and identity)

    There is no way I can see to create the primary key - you would have to script that from SSMS.

    To transfer the data, click the Edit Mappings button (on the table selection screen) and select the Enable Identity Insert option.

    To transfer the structure without the data, choose the 'Write A Query' option and write something like SELECT * FROM dbo.Table1 WHERE 0 = 1;

    Change the name from dbo.Query to dbo.Table1, and do the same trick as before with the Edit Mappings button / Enable Identity Insert.

    Alternatively, if the table is small, script it from SSMS (Tasks...Generate Scripts), specifying the indexes to include, and also the Script Data option.

    Paul