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