Register  |  Login




Advertisement

Start Your Own Q&A Site

Create your own Q&A site easily, allowing you to quickly grow a new community around any subject matter or generate new organic traffic for your existing website.

Question

Status: Open Points: 25 Time: 00:01 - Dec 29, 2008  

priyaravi2008

how to copy database from one drive to another drive in sql server?

how to copy or move database from one drive to another drive in sql server

Categories

Answer Discussion
Tutorials

 

muschika

Date:: Mar 12, 2009

Time:: 00:32

You can copy databases using two techniques:
1. Detach the databases from the server, copy the DatabaseName.mdf and DatabaseName.ldf files to the drive you want to copy to, and finally, attach the database by selecting the files from the new drive.
2. Backup the database and then restore it using 'WITH MOVE' and 'REPLACE' options.

Muschi.

priyaravi2008

Date:: Mar 20, 2009

Time:: 07:24

Thankyou muschi.it's very helpful.

yeneesha

Date:: Jun 24, 2009

Time:: 07:51

Before moving make a current backup of all databases.
you must have sys admin(sa) permissions
you should know the data file and log file locations

If you unaware of location of data and log files, can find it
using sp_helpfile stored procedure.

use <database_name>
go
sp_helpfile
go


to move database you can use attach/detach stored procedures

first detach database you want to move



use master
go
sp_detach_db 'database_name want to move'
go

next copy data and log files from the current location to new location

then re-attache the db to new location as follow

use master
go
sp_attach_db 'db_name','new location .mdf file','new location of .ldf file'
go

admin

Date:: Nov 27, 2009

Time:: 09:16

The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.

The Quomon Team

priyaravi2008

Date:: Nov 27, 2009

Time:: 23:44

thank you verymuch

Answer this Question

New User

Email:

Upon submission of this form, you will automatically be registered as a Quomon user and we will send your login information to this address

Registered User

Username:

Password:

Forgot Your Password?

Tutorials cannot be submitted until the Answer Discussion is complete.

Submit answers in the Answer Discussion area

Ask a Question

Have a new question? Ask!

You have 100 characters to use



Top Experts

View More

Rank

Expert

Points

1.

nidhi

10354

2.

oracleofDelphi

6493

3.

rcastagna

5596

4.

LAGM

4848

5.

PeterNZ

3487

6.

gonzalo

2840

7.

Mason

2770

8.

jgivoni

2303

9.

xarcus

1820

10.

Anpanman

917

Become an Expert

Register today to share your knowledge with the community and be recognized and rewarded for your contributions.


Register Here




"Psst, Quomon is a great site. Pass it on."     Tell a Friend  |   Link To Us  |   Save to Delicious  |   Digg! Digg it



Language Options

English:

www.quomon.com

Español:

www.quomon.es