473,322 Members | 1,510 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Primary Key fails to copy in db Export

ll
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
Feb 7 '08 #1
3 3555
ll (ba**********@yahoo.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, es****@sommarskog.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
Feb 7 '08 #2
ll
On Feb 7, 4:24 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
ll (barn104_1...@yahoo.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...@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
Feb 8 '08 #3
ll (ba**********@yahoo.com) 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, es****@sommarskog.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
Feb 8 '08 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: DaveR | last post by:
When I export a table from my local SQL Server to my web-host's SQL Server, the primary key never seems to export. This happens whether I use the "Copy tables and views..." option or the "Copy...
4
by: serge | last post by:
I ran into a table that is used a lot. Well less than 100,000 records. Maybe not a lot of records but i believe this table is used often. The table has 26 fields, 9 indexes but no Primary Key at...
5
by: shenanwei | last post by:
I have a primary server and backup server located in different physical sites. The primary server is live and ship logs to backup site every 5 minutes. The primary server is being full online...
8
by: chippy | last post by:
Hi, I've a VB script that creates a Access object in a word doc. Here is the full script. It works for all but the Export. Which always fails with a 3011 error. If I do the same in Access as a...
8
by: Jerome Ranch | last post by:
Okay So I've got pivot tables setup in Access 2003. Only about 30K records in the current 2005 databases...the pivots summarize the info in a number of nice ways. I need to get the pivot tables...
0
by: Mike | last post by:
In SQL 2000 I have been using Log Shipping to keep a warm backup copy of all my production databases in a different site. Prior to setting up my Maintenance Plan to implement log shipping, on my...
8
by: Challenge | last post by:
Hi, I got error, SQL1768N Unable to start HADR. Reason code = "7", when I tried to start hadr primary database. Here are the hadr configuration of my primary db: HADR database role ...
0
by: lanesbalik | last post by:
Hi All, I have DB2 v7.1 running on my linux machine. It try to export my data from my table using EXPORT function but fails. But the strange is when I run it on my local machine running DB2...
8
by: Joe Withawk | last post by:
I have a solution consisting of a c# project as win application and a c++ project as classlibrary. Both are .net 2.0 The classlibrary handles some loading of quicktime movies, but that should not...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.