简单的生成编号的存储过程
USE [Tr.TWX]
GO
/****** Object: StoredProcedure [dbo].[GetSysCode] Script Date: 2018/2/2 11:08:31 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[GetSysCode]
(
@TypeFlag SMALLINT
)
AS
BEGIN TRANSACTION
BEGIN
UPDATE Sys_Code WITH(ROWLOCK) SET Code=Code+1 WHERE TypeFlag=@TypeFlag;
SELECT Code FROM Sys_Code WHERE TypeFlag=@TypeFlag;
END
COMMIT TRANSACTION
GO
posted on 2018-02-02 11:13 chengjunde 阅读(97) 评论(0) 编辑 收藏 举报