473,703 Members | 2,381 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3574
ll (ba**********@y ahoo.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****@sommarsk og.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...@sommars kog.sewrote:
ll (barn104_1...@y ahoo.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...@sommarsk og.se

Books Online for SQL Server 2005 athttp://www.microsoft.c om/technet/prodtechnol/sql/2005/downloads/books...
Books Online for SQL Server 2000 athttp://www.microsoft.c om/sql/prodinfo/previousversion s/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**********@y ahoo.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****@sommarsk og.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
7844
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 objects and data..." option. Anybody know why this happens?
4
10560
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 all! There are no table relationships defined in this database, no Natural keys, only Surrogate keys in the database. 1- Maybe an odd question but is it normal to have 1/3 of the table's fields as indexes? Is this a valid question or it really
5
2416
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 backed up every sunday locally. Those logs are being applied to backup server every five minutes. For example, Primary site has power outage on tuesday, the last log was shipped was S0001000.LOG. Backup server was brought to live, the first active...
8
6989
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 straight Macro or script it works. Add it as an object and it won't work. HELP.
8
4863
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 into a document so I can distribute the tables, as is, as an electronic report (without the detailed data) So I export to rtf and xls, and I get an error that there is a too much information. I don't want all the data, just the summary table!
0
1331
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 Secondary server I create the warm backups using the following statement: RESTORE DATABASE ProdDB FROM DISK = 'E:\Backup\ProdDB\ProdDB.bak' WITH MOVE 'ProdDB_Data' TO 'E:\DATA\ProdDB.mdf', MOVE 'ProdDB_Log' TO 'E:\DATA\ProdDB.ldf', STANDBY =...
8
23456
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 = STANDARD HADR local host name (HADR_LOCAL_HOST) = testserver HADR local service name (HADR_LOCAL_SVC) = 56000 HADR remote host name (HADR_REMOTE_HOST) = testserver
0
1151
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 v9 express under Windows XP, it run perfectly!! This is the SQL = export to '/home/db2inst1/db2-migrate/MYTABLE01.del' of del modified by timestampformat="yyyy-mm-dd hh:mm:ss" select * from MYTABLE01
8
3740
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 be relevant. On my development machine I build the exe and dll and run the exe which has a reference to the dll. At some point it uses featured in the dll. This works fine. Then I copy my exe and dll to the target system and when the featured...
0
8662
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9111
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8961
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7853
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6585
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4421
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4679
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
2439
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2058
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.