首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

SQL Server 2005带事宜的存储过程示例[自用标记]

2012-08-24 
SQL Server 2005带事务的存储过程示例[自用标记]set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo--

SQL Server 2005带事务的存储过程示例[自用标记]

set ANSI_NULLS ONset QUOTED_IDENTIFIER ONgo-- =============================================-- Author:<Author,,Name>-- Create date: <Create Date,,>-- Description:<Description,,>-- =============================================ALTER PROCEDURE [dbo].[ssidb_DeleteDepartment]@orgID varchar(32)ASBEGINbegin tran TranStartsave tran FirstPointupdate [dbo].[ssidb_Organization]set [DelFlag]=1where [ID]=@orgIDupdate [dbo].[ssidb_Organization]set [DelFlag]=1where ID in (select a.ID from dbo.ssidb_Organization a, dbo.ssidb_f_cid(@orgID) bwhere a.ID = b.ID)if @@ERROR <> 0begin rollback tran FirstPointendcommit tran TranStartEND

热点排行