恢复数据:
CREATE PROCEDURE restore_data
@databasename varchar(20),@backup_device varchar(100),@logical_name varchar(100),@path_name varchar(100),
@logical_log varchar(100),@path_log varchar(100)
as
begin
restore database @databasename from disk =@backup_device
with move @logical_name to @path_name,
move @logical_log to @path_log,replace
end
SET QUOTED_IDENTIFIER OFF SET ANSI_NULLS ON
GO
恢复日志:
CREATE PROCEDURE restore_logical
@backup_device varchar(100)
as
begin
restore filelistonly from disk =@backup_device
end
GO