PC Review Forums Newsgroups Microsoft DotNet Microsoft ADO .NET SQL Server Management Studio - not preserving identities during import

Reply

SQL Server Management Studio - not preserving identities during import

 
Thread Tools Rate Thread
Old 07-02-2006, 08:34 PM   #1
Eric
Guest
 
Posts: n/a
Default SQL Server Management Studio - not preserving identities during import


I want to copy my local database to a remote server hosted by a thrid
party company. I started by creating all the tables using creation
scripts made by SSMS. Then I connected to the target database, and used
Tasks, Import to copy my local data to the remote database. I made sure
to select the Identity Insert checkbox for every table. After the
import, my data was there, except the identity values didn't come
across - they all got renumbered starting with 1. This broke my foreign
key relationships. How can I import the data so my identity values are
preserved (I'm starting with an empty target DB)?

PS: I can't use SQL "insert" scripts to migrate the data because some
columns have image data.

  Reply With Quote
Old 08-02-2006, 03:20 AM   #2
=?Utf-8?B?VmFsIE1henVyIChNVlAp?=
Guest
 
Posts: n/a
Default RE: SQL Server Management Studio - not preserving identities during im

Eric,

If this is just a one-time task, then you could detach database from your
server and attach it to the target database. In this case all the data will
remain the same

--
Val Mazur
Microsoft MVP
http://xport.mvps.org


"Eric" wrote:

> I want to copy my local database to a remote server hosted by a thrid
> party company. I started by creating all the tables using creation
> scripts made by SSMS. Then I connected to the target database, and used
> Tasks, Import to copy my local data to the remote database. I made sure
> to select the Identity Insert checkbox for every table. After the
> import, my data was there, except the identity values didn't come
> across - they all got renumbered starting with 1. This broke my foreign
> key relationships. How can I import the data so my identity values are
> preserved (I'm starting with an empty target DB)?
>
> PS: I can't use SQL "insert" scripts to migrate the data because some
> columns have image data.
>
>

  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off