Welcome to dbForumz.com!
FAQFAQ    SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Primary Key fails to copy in db Export

 
   Database Forums (Home) -> General Discussions RSS
Next:  Cancel Print  
Author Message
ll

External


Since: May 07, 2007
Posts: 8



(Msg. 1) Posted: Thu Feb 07, 2008 8:39 am
Post subject: Primary Key fails to copy in db Export
Archived from groups: comp>databases>ms-sqlserver (more info?)

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

 >> Stay informed about: Primary Key fails to copy in db Export 
Back to top
Login to vote
--CELKO--

External


Since: Apr 17, 2007
Posts: 417



(Msg. 2) Posted: Thu Feb 07, 2008 11:48 am
Post subject: Re: Primary Key fails to copy in db Export [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

>> 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?

 >> Stay informed about: Primary Key fails to copy in db Export 
Back to top
Login to vote
ll

External


Since: May 07, 2007
Posts: 8



(Msg. 3) Posted: Thu Feb 07, 2008 1:34 pm
Post subject: Re: Primary Key fails to copy in db Export [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 7, 1:48 pm, --CELKO-- wrote:
> >> 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.
 >> Stay informed about: Primary Key fails to copy in db Export 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 1647



(Msg. 4) Posted: Thu Feb 07, 2008 9:00 pm
Post subject: Re: Primary Key fails to copy in db Export [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ll ( ) 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, esquel RemoveThis @sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 >> Stay informed about: Primary Key fails to copy in db Export 
Back to top
Login to vote
ll

External


Since: May 07, 2007
Posts: 8



(Msg. 5) Posted: Fri Feb 08, 2008 1:39 pm
Post subject: Re: Primary Key fails to copy in db Export [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

On Feb 7, 4:24 pm, Erland Sommarskog wrote:
> ll ( ) 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....TakeThisOut@sommarskog.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
 >> Stay informed about: Primary Key fails to copy in db Export 
Back to top
Login to vote
Erland Sommarskog2

External


Since: May 30, 2004
Posts: 1647



(Msg. 6) Posted: Fri Feb 08, 2008 8:02 pm
Post subject: Re: Primary Key fails to copy in db Export [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

ll ( ) writes:
> 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.TakeThisOut@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
 >> Stay informed about: Primary Key fails to copy in db Export 
Back to top
Login to vote
Display posts from previous:   
Related Topics:
how to create my own primary key which auto-increment - Hi, I'm a newbie in sql server. I want to create a primary key that should be auto incremented. for example: C0001, C0002, C0003, C0004 etc here are the attributes I have for the table cust_id, cust_name, cust_address etc

confusion over indexs via primary key and clustered index - Hi I thought that given a table with an index, primary key and clustered index any non clustered index look ups would go via the clustered index and the primary key is irrelevant? (sql server 2000). A colleague has said that the primary key should be..

Export SPs? - I have uses DTS Import/Export wizard to export all my tables from one databse to another on the same server. How do I export all of my stored procedures and UDFs? Thanks, lq

table copy - I have two identical tables with one IDENTITY column and several other columns. I have tested the COPY * INTO table2 FROM table1 WHERE xx but it requers that table2 does not exist. TABLE2 is a history database of TABLE1 How can I copy row(s) from table1....

Synchronous Bulk-Copy into two table - Hi guys, in my db i have these three tables 1.Stores 2.Products 3.Parts their structure is something like : Stores ----> Products ----> Parts Stores ---------------- StoreId, StoreName Products ---------------- ProductId, StoreId, Produ...
   Database Forums (Home) -> General Discussions All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You can edit your posts in this forum
You can delete your posts in this forum
You can vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]