SqlServer backup and restore

Useful commands…

–Addumpdevice…
https://msdn.microsoft.com/en-gb/library/ms188409(v=sql.110).aspx

— restore options
https://msdn.microsoft.com/en-gb/library/ms186858(v=sql.110).aspx

USE master;
GO
EXEC sp_addumpdevice ‘disk’, ‘mydiskdump’, ‘F:\ssistemp\BikeRides.Bak’;

select * from sys.backup_devices

 

restore database BikeRides
from mydiskdump
with
move ‘BikeRides’ to ‘f:\database\data\BikeRides.mdf’,
move ‘BikeRides_log’ to ‘f:\database\logs\BikeRides_log.ldf’