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.

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 am new to SqlCmd. Can anyone give a short explanation of the following command?

"RESTORE DATABASE GIS_ENG FROM DISK = N'\\\ClientData\Backup\DatabaseBackups\DB_ENG.bak' 
WITH  FILE = 1, 
MOVE N'DB_ENG_log' TO N'\\\E$\SQLSERVER\Data\DB_ENG.ldf',  
share|improve this question
up vote 2 down vote accepted

Sure it is saying to use SQLCMD.EXE connecting to the server instance VMLIVE-DATA\SQLSERVER, to run the script that will restore the GIS_ENG from a backup of the DB_ENG database, replacing the existing GIS_ENG if there is one.

The bulk of the text is the script -Q"RESTORE ... STATS=10".

The SQLCMD and RESTORE DATABASE parameters are define in the SQL Server documentation.



By default SQLCMD uses Trusted Connections (describe in the SQLCMD link) so it requires this to be run by a login with rights to restore a database.

share|improve this answer
What about this line "NOUNLOAD, REPLACE, STATS = 10" – Nav Ali Sep 28 '13 at 19:32
NOUNLOAD means do not unload a tape. Commonly included in scripts, but hardly anybody uses tape anymore, so it is a NoOp. REPLACE forced the DB_ENG backup being restored to replace the existing GIS_ENG database as a new GIS_ENG database. STATS=10 defines what monitoring of the restore gets reported. In this case, every 10%. This is in the RESTORE link above or in linked topics connecting on BACKUP and RESTORE. – RLF Sep 28 '13 at 19:44

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.