anandan.cr@gmail.com
Member
- Local time
- , 17:16
- Joined
- Oct 7, 2016
- Messages
- 43
I have created a SQL Server Sequence (Backend)
CREATE SEQUENCE [dbo].[Airlines_Mast_SEQ]
AS [int]
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 99999
CACHE
GO
CREATE TABLE [dbo].[Airlines_Mast](
[ID] [int] NOT NULL DEFAULT NEXT VALUE FOR [Airlines_Mast_SEQ] PRIMARY KEY,
[Airlines_ID] AS ('AS'+right('00000'+CONVERT([varchar],[ID]),(6))) PERSISTED NOT NULL,
[Airlines_CODE] [varchar](4) NOT NULL,
[Airlines_Name] [nvarchar](100) NOT NULL,
[Airlines_GSTIN] [varchar](15) NOT NULL,
[Airlines_Address1] [nvarchar](100) NULL,
[Airlines_Pincode] [varchar](10) NULL,
[Legal_Name] [nvarchar](100) NULL,
[Type] [varchar](15) NULL,
[Airlines_Active] [bit] NOT NULL
) ON [PRIMARY]
MS Access(Front End)
I have created a Form in MS Access using table Airlines_Mast , while entering data in Form
(1) When Data is correctly entered for a Record in one Go then SEQUENCE is maintained but, (2) When invalid Data is entered multiple time for a Record after validation check then SEQUENCE got jumped to next sequence.
Kindly suggest to maintain the sequence without Jump.
CREATE SEQUENCE [dbo].[Airlines_Mast_SEQ]
AS [int]
START WITH 1
INCREMENT BY 1
MINVALUE 1
MAXVALUE 99999
CACHE
GO
CREATE TABLE [dbo].[Airlines_Mast](
[ID] [int] NOT NULL DEFAULT NEXT VALUE FOR [Airlines_Mast_SEQ] PRIMARY KEY,
[Airlines_ID] AS ('AS'+right('00000'+CONVERT([varchar],[ID]),(6))) PERSISTED NOT NULL,
[Airlines_CODE] [varchar](4) NOT NULL,
[Airlines_Name] [nvarchar](100) NOT NULL,
[Airlines_GSTIN] [varchar](15) NOT NULL,
[Airlines_Address1] [nvarchar](100) NULL,
[Airlines_Pincode] [varchar](10) NULL,
[Legal_Name] [nvarchar](100) NULL,
[Type] [varchar](15) NULL,
[Airlines_Active] [bit] NOT NULL
) ON [PRIMARY]
MS Access(Front End)
I have created a Form in MS Access using table Airlines_Mast , while entering data in Form
(1) When Data is correctly entered for a Record in one Go then SEQUENCE is maintained but, (2) When invalid Data is entered multiple time for a Record after validation check then SEQUENCE got jumped to next sequence.
Kindly suggest to maintain the sequence without Jump.