完成了数据库实验

exec sp_addumpdevice 'disk','backup1','D:\SQLserver\MSSQL15.MSSQLSERVER\MSSQL\Backup\backup1.bak';
exec sp_addumpdevice 'disk','backup2','D:\SQLserver\MSSQL15.MSSQLSERVER\MSSQL\Backup\backup2.bak';
insert into Teaching (teach) values('1');
BACKUP DATABASE students
TO DISK = 'D:\SQLserver\MSSQL15.MSSQLSERVER\MSSQL\Backup\backup2.bak'
WITH differential, noinit; -- 如果有同名文件,则覆盖它
backup log students
to disk='D:\SQLserver\MSSQL15.MSSQLSERVER\MSSQL\Backup\backup2_log.bak'
WITH NORECOVERY
delete from Teaching where teach='1';
drop table Teaching;
restore database students from backup1
with file =1,RECOVERY;
ALTER DATABASE [YourDatabaseName]
SET RECOVERY FULL
WITH NO_WAIT;

代码20行

时间 0.5小时