Take the 2-minute tour ×
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. It's 100% free, no registration required.

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

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

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

1 Answer 1

up vote 8 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 MCSA Aug 15 '11 at 11:29

Your Answer

 
discard

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.