create table A ( name varchar(20) )insert A select 'AAA'--insert测试 begin tran insert A select 'BBB' rollback transelect * from A--结果 /*name -------------------- AAA(所影响的行数为 1 行) */--update测试 begin tran update A set name='BBB' rollback transelect * from A--结果 /*name -------------------- AAA(所影响的行数为 1 行) */--delete测试 begin tran delete A rollback transelect * from A--结果 /*name -------------------- AAA(所影响的行数为 1 行) */--truncate测试 begin tran truncate table A rollback transelect * from A--结果 /* name -------------------- AAA(所影响的行数为 1 行) */--drop测试 begin tran drop table A rollback transelect * from A--结果 /* name -------------------- AAA(所影响的行数为 1 行) */ --create 测试 begin tran create table B(name varchar(10)) rollback transelect * from B--结果 /* 服务器: 消息 208,级别 16,状态 1,行 1 对象名 'B' 无效。 */ drop table A
(
name varchar(20)
)insert A select 'AAA'--insert测试
begin tran
insert A select 'BBB'
rollback transelect * from A--结果
/*name
--------------------
AAA(所影响的行数为 1 行)
*/--update测试
begin tran
update A set name='BBB'
rollback transelect * from A--结果
/*name
--------------------
AAA(所影响的行数为 1 行)
*/--delete测试
begin tran
delete A
rollback transelect * from A--结果
/*name
--------------------
AAA(所影响的行数为 1 行)
*/--truncate测试
begin tran
truncate table A
rollback transelect * from A--结果
/*
name
--------------------
AAA(所影响的行数为 1 行)
*/--drop测试
begin tran
drop table A
rollback transelect * from A--结果
/*
name
--------------------
AAA(所影响的行数为 1 行)
*/
--create 测试
begin tran
create table B(name varchar(10))
rollback transelect * from B--结果
/*
服务器: 消息 208,级别 16,状态 1,行 1
对象名 'B' 无效。
*/
drop table A