ALTER proc [dbo].[p_BOGetMCBSecurityCheckPropertiesTypeAdd]
@Name nvarchar(50), ---参数
@MCBBadlyBuiltType_ID uniqueidentifier
--,@ID uniqueidentifier output
as
begin
BEGIN TRANSACTION --开始事务
declare @IDD uniqueidentifier
begin
set @IDD=newid();
insert into MCBSecurityCheckPropertiesType(ID,MCBBadlyBuiltType_ID,Name,UserInfo_ID,SetTime)
values(@IDD,@MCBBadlyBuiltType_ID,@Name,1,GETDATE())
if @@error<>0 begin ROLLBACK TRANSACTION goto quit end --判断是否成功
end
select @IDD ID
end
COMMIT TRANSACTION quit: --成功则回滚