T-SQL 生成流水号、调用存贮过程

2024-01-09 13:11:18

1、流水号表结构

 
CREATE TABLE [dbo].[BASE_Sequence](
	[SeqCode] [varchar](60) NOT NULL,
	[Desc] [nvarchar](150) NULL,
	[NowSeqValue] [nchar](10) NULL,
	[CreateTime] [datetime] NULL,
	[DateMax] [varchar](10) NULL,
	[MaxVlaue] [bigint] NULL,
	[CreateBy] [varchar](50) NULL,
	[Length] [int] NULL,
	[Status] [varchar](1) NULL,
	[InitValue] [varchar](10) NULL,
	[ResetType] [varchar](50) NULL,
	[IsRunning] [char](1) NULL,
 CONSTRAINT [PK_BASE_Sequence] PRIMARY KEY CLUSTERED 
(
	[SeqCode] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, OPTIMIZE_FOR_SEQUENTIAL_KEY = OFF) ON [PRIMARY]
) ON [PRIMARY]
GO
INSERT [dbo].[BASE_Sequence] ([SeqCode], [Desc], [NowSeqValue], [CreateTime], [DateMax], [MaxVlaue], [CreateBy], [Length], [Status], [InitValue], [ResetType], [IsRunning]) VALUES (N'AGV_ActivePushMaterial', N'AGV配送', N'4         ', CAST(N'2023-10-16T15:37:00.000' AS DateTime), N'20231016', 99999999, N'CX', 4, N'1', N'1', N'2', N'1')
GO
INSERT [dbo].[BASE_Sequence] ([SeqCode], [Desc], [NowSeqValue], [CreateTime], [DateMax], [MaxVlaue], [CreateBy], [Length], [Status], [InitValue], [ResetType], [IsRunning]) VALUES (N'Operation_Siemens_S_700803909', N'工序目录(工序池)Nid流水号', N'575       ', CAST(N'2023-09-06T16:11:27.593' AS DateTime), N'20231218', 999999, N'Liz', 6, N'1', N'1', N'1', N'1')
GO
INSERT [dbo].[BASE_Sequence] ([SeqCode], [Desc], [NowSeqValue], [CreateTime], [DateMax], [MaxVlaue], [CreateBy], [Length], [Status], [InitValue], [ResetType], [IsRunning]) VALUES (N'PR_ReworkTask', N'返工任务单流水号', N'9         ', CAST(N'2023-10-07T11:19:00.000' AS DateTime), N'20231225', 99999999, N'CX', 4, N'1', N'1', N'4', N'1')
GO
INSERT [dbo].[BASE_Sequence] ([SeqCode], [Desc], [NowSeqValue], [CreateTime], [DateMax], [MaxVlaue], [CreateBy], [Length], [Status], [InitValue], [ResetType], [IsRunning]) VALUES (N'PR_WorkOrder_WorkingHours', N'工时上报流水号', N'14        ', CAST(N'2023-09-20T11:34:00.00

文章来源:https://blog.csdn.net/lybwwp/article/details/135475629
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。