dbTalk Databases Forums  

Primary Key fails to copy in db Export

comp.databases.ms-sqlserver comp.databases.ms-sqlserver


Discuss Primary Key fails to copy in db Export in the comp.databases.ms-sqlserver forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
ll
 
Posts: n/a

Default Primary Key fails to copy in db Export - 02-07-2008 , 10:39 AM






Currently, I'm exporting a database from production to local (test)
machine. I've done this several times without problem, but during the
last few days, the primary keys have failed to export. Would anyone
know what options might keep the keys from exporting?

Thanks,
Louis

Reply With Quote
  #2  
Old   
--CELKO--
 
Posts: n/a

Default Re: Primary Key fails to copy in db Export - 02-07-2008 , 01:48 PM






Quote:
but during the last few days, the primary keys have failed to export. Would anyone know what options might keep the keys from exporting?
are you using IDENTITY instead of a real relational key?


Reply With Quote
  #3  
Old   
ll
 
Posts: n/a

Default Re: Primary Key fails to copy in db Export - 02-07-2008 , 03:34 PM



On Feb 7, 1:48 pm, --CELKO-- <jcelko... (AT) earthlink (DOT) net> wrote:
Quote:
but during the last few days, the primary keys have failed to export. Would anyone know what options might keep the keys from exporting?

are you using IDENTITY instead of a real relational key?

No, these are the real variety.


Reply With Quote
  #4  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Primary Key fails to copy in db Export - 02-07-2008 , 04:24 PM



ll (barn104_1999 (AT) yahoo (DOT) com) writes:
Quote:
Currently, I'm exporting a database from production to local (test)
machine. I've done this several times without problem, but during the
last few days, the primary keys have failed to export. Would anyone
know what options might keep the keys from exporting?
It may help to tell which version of SQL Server you are using what
means you use for export. There are a number of different ways.

The best is usually to do BACKUP/RESTORE.

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
  #5  
Old   
ll
 
Posts: n/a

Default Re: Primary Key fails to copy in db Export - 02-08-2008 , 03:39 PM



On Feb 7, 4:24 pm, Erland Sommarskog <esq... (AT) sommarskog (DOT) se> wrote:
Quote:
ll (barn104_1... (AT) yahoo (DOT) com) writes:
Currently, I'm exporting a database from production to local (test)
machine. I've done this several times without problem, but during the
last few days, the primary keys have failed to export. Would anyone
know what options might keep the keys from exporting?

It may help to tell which version of SQL Server you are using what
means you use for export. There are a number of different ways.

The best is usually to do BACKUP/RESTORE.

--
Erland Sommarskog, SQL Server MVP, esq... (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 athttp://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.com/sql/prodinfo/previousversions/books.mspx


Thanks Erland,
I'm currently using MS SQL Server 2000. A colleague said that she
thought that there was a way to set a property to 'preserve the
primary keys in the tables, although I haven't located that yet.
Would SQL 2000 have a place to make this adjustment?

Thanks,
Louis


Reply With Quote
  #6  
Old   
Erland Sommarskog
 
Posts: n/a

Default Re: Primary Key fails to copy in db Export - 02-08-2008 , 04:33 PM



ll (barn104_1999 (AT) yahoo (DOT) com) writes:
Quote:
I'm currently using MS SQL Server 2000. A colleague said that she
thought that there was a way to set a property to 'preserve the
primary keys in the tables, although I haven't located that yet.
Would SQL 2000 have a place to make this adjustment?
I still don't know what you are talking about. OK, I know there is
some export/import thing in Enterprise Manager, but I have never
used it.

There are several ways to move things from production to test, and
the absolutely simplest way is to use BACKUP/RESTORE. In that case
you don't have to worry about primary keys or anything else not being
copied. All you need to care about is to fix user/login mapping.

Other ways to export data is to build the datbase from scripts (preferrably
kept under source control) and then use INSERT/SELECT or bulk copy to
move the data.

The last thing I would set my bets on is something that scripts the database
for me, and does a lot things behind my back that I don't know if I can
trust or not.

So, is there any particular reason BACKUP/RESTORE is not the right thing
for you?

--
Erland Sommarskog, SQL Server MVP, esquel (AT) sommarskog (DOT) se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


Reply With Quote
Reply




Thread Tools
Display Modes

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



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.