468,242 Members | 1,591 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,242 developers. It's quick & easy.

export relationships in SQL 2000

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
3 2490
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
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
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.

Similar topics

2 posts views Thread by Max | last post: by
1 post views Thread by Mr. California | last post: by
7 posts views Thread by davegb | last post: by
2 posts views Thread by David Richards | last post: by
reply views Thread by NPC403 | last post: by
reply views Thread by kermitthefrogpy | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.