use master
go
create database test
backup database test to disk = 'e:\mssql7\backup\test.bak'
exec sp_dboption test, 'autoclose', true
-- wait for database to be closed
waitfor delay '00:00:10'
exec xp_cmdshell 'del e:\mssql7\data\test.mdf'
go
--try recovering the database
dbcc dbrecover(test)
go
-- error here, try log backup
backup log test to disk = 'e:\mssql7\backup\test_log.bak' with no_truncate
go
drop database test
go
-- cleanup
exec xp_cmdshell 'del e:\mssql7\backup\test.bak&del e:\mssql7\data\test_log.ldf'
This page was last updated on May 01, 2006 04:28 PM.