Reputation: 709
How do I export a SQL Server 2000/2005 database to MDF/LDF files? I do not have access to detach the database nor do I have access to login to the database server to copy the files directly.
Upvotes: 2
Views: 3377
Reputation: 280252
Can you run commands against the database from a query window? Do you know of a network path accessible to both you and the SQL Server instance? If so then you can issue the following query (instead of trying to coax some backup through the UI):
BACKUP DATABASE dbname TO DISK = '\\some_network_path_you\have_access_to\db.bak'
WITH COPY_ONLY, INIT;
COPY_ONLY
is important so that you don't disrupt the production server's log chain.
Then you can copy that file and run RESTORE DATABASE
wherever you like.
You don't want to somehow get access to the MDF / LDF files. For one, in order to copy those, you need to shut down the source SQL Server and detach them. This can lead to many bad things, but most importantly downtime on the production server, and the risk that if something should go wrong, you now have ZERO copies of your database.
Upvotes: 5