export relationships in SQL 2000

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

    export relationships in SQL 2000

    I've exported the tables and data in SQL2000 using the wizard,
    although I would also like to be able to export the relationships.
    I've re-established the PKs manually already.
    Regarding the relationships, is there a way to re-establish them in
    the exported, local copy of the db with the export wizard, or is there
    a good resource online which might explain the process to me, as I'm
    new with SQL server?

    Thanks
    Louis
  • Erland Sommarskog

    #2
    Re: export relationships in SQL 2000

    ll (barn104_1999@y ahoo.com) writes:
    I've exported the tables and data in SQL2000 using the wizard,
    although I would also like to be able to export the relationships.
    I've re-established the PKs manually already.
    Regarding the relationships, is there a way to re-establish them in
    the exported, local copy of the db with the export wizard, or is there
    a good resource online which might explain the process to me, as I'm
    new with SQL server?
    What did you really want to achieve? Sounds as if you wanted a copy of
    your database, in which case a BACKUP/RESTORE would be better.


    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Links for SQL Server Books Online:
    SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
    SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
    SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

    Comment

    • ll

      #3
      Re: export relationships in SQL 2000

      On Aug 29, 4:46 pm, Erland Sommarskog <esq...@sommars kog.sewrote:
      ll (barn104_1...@y ahoo.com) writes:
      I've exported the tables and data in SQL2000 using the wizard,
      although I would also like to be able to export the relationships.
      I've re-established the PKs manually already.
      Regarding the relationships, is there a way to re-establish them in
      the exported, local copy of the db with the export wizard, or is there
      a good resource online which might explain the process to me, as I'm
      new with SQL server?
      >
      What did you really want to achieve? Sounds as if you wanted a copy of
      your database, in which case a BACKUP/RESTORE would be better.
      >
      --
      Erland Sommarskog, SQL Server MVP, esq...@sommarsk og.se
      >
      Links for SQL Server Books Online:
      SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
      SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
      SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx


      That would be great, if I could restore from the prod server to my
      local machine.
      Is there a way to do this?
      Thanks.

      Comment

      • Erland Sommarskog

        #4
        Re: export relationships in SQL 2000

        ll (barn104_1999@y ahoo.com) writes:
        That would be great, if I could restore from the prod server to my
        local machine.
        Is there a way to do this?
        Provided that it is possible for you to copy the backup file to your
        local box, yes.

        BACKUP DATABASE db TO DISK = 'somepath.bak'

        Supposedly there are backups taken of the database regularly. The DBA may
        prefer if you take one of these backups rather than taking your own.

        Copy the file to your machine, or put it on a network share that you can
        access. (You can backup directly to the backup device as well.)

        Once you have access to the backup:

        RESTORE DATABASE db FROM DISK = 'somepath.bak' WITH
        MOVE 'datadev' TO 'yourdatadir\db .mdf',
        MOVE 'logdev' TO 'yourdatadir\db .ldf',
        REPLACE

        There "datadev" and "logdev" are the logical name of the database files,
        you find these with sp_helpdb in the second leftmost column, or with
        RESTORE FILELISTONLY.

        yourdatadir is where you have your datbase files.

        If the database has more than two data files, you need to list them
        all in the RESTORE statement.



        --
        Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

        Links for SQL Server Books Online:
        SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
        SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
        SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

        Comment

        Working...