Another approach to SQL Server backup and restore, aside from using Enterprise Manager, is to use T-SQL commands. Enterprise Manager can be a quick and easy way to run backups or restores, but T-SQL offers a lot more flexibility. With T-SQL you can script your backups or script to restore several backup files.
As a developer, a quick and easy way to backup & restore is essential; especially after hours when your in a hurry to get it done and go home.
My typical process is to restore to another db. Create a new database to use as a holding spot for the restore (PondWaterEAVRestore). It can be restored to your backup using following TSQL:
Restore: Retrieve the Logical file name of the database from SSMS. With this example, the ndf will also be restored and associated with the db:
To get the name of the logical files and where it expects to put them you
can use:
RESTORE FILELISTONLY
FROM DISK =
'c:\_sql\backup\pondwater.bak'
GO
If you are using Godaddy, create the database locally and add in another file with prefix ‘sysft’. Then you can copy your backup file from your Godaddy server to your local box and do a restore:
restore database Pondwater
from disk = 'c:\_sql\backup\pondwater.bak'
with REPLACE,
MOVE 'pondwater' TO 'C:\_SQL\pondwater.mdf',
MOVE 'sysft_pondwater' TO 'C:\_SQL\sysft_pondwater.ndf',
MOVE 'pondwater_log' TO 'C:\_SQL\pondwater_log.ldf'