This is a discussion on Primary Key fails to copy in db Export within the SQL Server forums, part of the Microsoft SQL Server category; --> Currently, I'm exporting a database from production to local (test) machine. I've done this several times without problem, but ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| 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 |
| |||
| On Feb 7, 1:48 pm, --CELKO-- <jcelko...@earthlink.net> 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. |
| |||
| ll (barn104_1999@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, esquel@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 |
| |||
| On Feb 7, 4:24 pm, Erland Sommarskog <esq...@sommarskog.se> wrote: > 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 |
| ||||
| ll (barn104_1999@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, esquel@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 |
| Thread Tools | |
| Display Modes | |
|
|