sqlserver数据库事务

阅读更多
create table AA_student
(
  id int PRIMARY KEY IDENTITY(1,1),
  name varchar(10),
  age int
)


alter PROCEDURE API_FLOWTEST
as
BEGIN
SET XACT_ABORT ON
begin tran
insert into AA_student(name,age) values('中国人民a',null);
insert into AA_student(name,age) values('中国人民共中国人民共中国人民共',null);  --插入name,字符超过定义大小
insert into AA_student(name,age) values('中国人民b',null);
commit tran
end

declare @result int
exec @result = API_FLOWTEST
print @result

你可能感兴趣的:(sqlserver数据库事务)