TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Jes Sie
736
1.2k
284.4k
What is the best way to increment a transaction number
Sep 20 2017 5:22 AM
I am currently developing a travel insurance system. In my table, I have a transaction number which should increment by 1 every transaction. I tried using the code below in my previous development but primary column ID jumps (e.g. before insert row number is 10 after insert row number becomes 12). The travel insurance that I currently developing will be used entire Laos country. That means I am expecting concurrent users of +/- 200.
ALTER
PROCEDURE
[dbo].[spAutoGenerateMotorCINo]
AS
BEGIN
declare
@ID
int
, @RefNumber nvarchar(15);
Select
@ID =
ISNULL
(
Max
(
Cast
(
RIGHT
(MotorInsuranceID, 15)
as
int
)), 0) + 1
from
tblMotorInsurance_eCI;
Select
RIGHT
(
cast
(@ID
as
nvarchar), 9);
END
Thank you in advance for any suggestions and recommendations.
Reply
Answers (
1
)
how to store a decimal value in c# ?.
Virtual mail in asp .net