Example
The following example restores the master database on the default server instance.
The example assumes that the server instance is already running in single-user mode.
The example starts sqlcmd and executes a RESTORE DATABASE statement that restores
a full database backup of master from a disk device: Z:\SQLServerBackups\master.bak.
Note for NAMED ISTANCE
For a named instance, the sqlcmd command must specify the -S<ComputerName>\<InstanceName> option.
PROCEDURE:
C:\> sqlcmd
RESTORE DATABASE master FROM DISK = 'Z:\SQLServerBackups\master.bak' WITH REPLACE;
GO