Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm a bit confused over the T-SQL command MOVE. I have a statement saying:

N'C:\Program Files\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\DATA\Test_Database.mdf'

The same statement is used on the log: Prod_Database_Log. I think the statement just makes a copy of the database and not actually moves the original database. Am I right or have I missed something fundamentally crucial?

share|improve this question
up vote 9 down vote accepted

There is no MOVE command.

There is the "RESTORE" command with arguments "WITH MOVE"

This deletes the old MDF and LDF files (if database already exists) and recreate the MDF/LDF files (and NDFs etc) where specified

share|improve this answer
Thanx! Just what I needed to know. It is (as you say) after a RESTORE command. – Benny Skogberg Aug 15 '11 at 11:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.