hey frnds...
i have a digit like this....
1300000001
after 1300000009
it should be 1300000010
after 1300000099
it should be 1300000100
1300000101
etc
please give me solution if you have
thanks.....
Loading
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 10, 2013, 9:24 PM EST
are you looking solution in which platform SQL or C#?
Mukesh Kumar TiwariRank #1,774 · 844 reputationPosted Dec 10, 2013, 9:30 PM EST
in 2013 it will be start from 13
in 2014 it will be start from 14
and it will be of 10 digit...
this type of req i have..
you can give soluaition in both c# or sql....
thanks
Jignesh TrivediRank #16 · 50.3K reputationPosted Dec 10, 2013, 9:38 PM EST
hi,
Try in SQL
Declare @id int = 10
select right(year(getdate()),2) + RIGHT('0000000000' + CAST(@id AS VARCHAR(7)), 7)
Also refer my article
http://www.c-sharpcorner.com/UploadFile/ff2f08/auto-incremented-column-with-varchar-and-nvarchar-data-type/
hope this will help you.
VulpesRank #55 · 29.2K reputationPosted Dec 11, 2013, 12:26 AM EST
The output is: