Primary Key fails to copy in db Export

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ll

    Primary Key fails to copy in db Export

    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
  • Erland Sommarskog

    #2
    Re: Primary Key fails to copy in db Export

    ll (barn104_1999@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, esquel@sommarsk og.se

    Books Online for SQL Server 2005 at

    Books Online for SQL Server 2000 at

    Comment

    • ll

      #3
      Re: Primary Key fails to copy in db Export

      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

      Comment

      • Erland Sommarskog

        #4
        Re: Primary Key fails to copy in db Export

        ll (barn104_1999@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, esquel@sommarsk og.se

        Books Online for SQL Server 2005 at

        Books Online for SQL Server 2000 at

        Comment

        Working...