By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,806 Members | 1,841 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,806 IT Pros & Developers. It's quick & easy.

export relationships in SQL 2000

P: n/a
ll
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
Aug 29 '08 #1
Share this Question
Share on Google+
3 Replies


P: n/a
ll (ba**********@yahoo.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, es****@sommarskog.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

Aug 29 '08 #2

P: n/a
ll
On Aug 29, 4:46 pm, Erland Sommarskog <esq...@sommarskog.sewrote:
ll (barn104_1...@yahoo.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...@sommarskog.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.
Sep 4 '08 #3

P: n/a
ll (ba**********@yahoo.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, es****@sommarskog.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

Sep 4 '08 #4

This discussion thread is closed

Replies have been disabled for this discussion.