Yes. If you want to use the same database files as the original database, omit the MOVE options e.g.
EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\backups\AdventureWorks.sqb]"'
If you want to create new database files, use the MOVE options e.g.
EXEC master..sqlbackup '-sql "RESTORE DATABASE AdventureWorks_copy FROM DISK = [g:\backups\AdventureWorks.sqb] WITH MOVE [AdventureWorks_dat] TO [e:\sqldata\AdventureWorks_copy.mdf], MOVE [AdventureWorks_log] to [e:\sqldata\AdventureWorks_copy.ldf]"'
Peter Yeoh
SQL Backup Consultant Developer
Associate, Yohz Software Beyond compression - SQL Backup goodies under the hood, updated for version 8
Comments
If you want to create new database files, use the MOVE options e.g.
SQL Backup Consultant Developer
Associate, Yohz Software
Beyond compression - SQL Backup goodies under the hood, updated for version 8