Auto Generate Unique ID in SQL Server ASP.NET C# | CODERBABA

Опубликовано: 10 Октябрь 2024
на канале: Coder Baba
6,971
69

How to auto generate Unique user define Employee ID like (EMP001) with help of SQL Server in ASP.NET C#.
--------------------------
Step-1: Create a Table in SQL Server Database


create table tblemployee2
(
employeeId nvarchar(50),
empname nvarchar(50),

)
__________________________________
step-2: Insert a record

insert into tblemployee2 values('DYR4','VARI kumar')

--------------------------------------------------
Step-3: Use below mention select query
select 'FHMS'+ cast (max(cast(SUBSTRING( employeeId ,4, 5 )as int))+1 as nvarchar) as EmpID
from tblemployee2


_______________________________________
#coderbaba #AutoGenerateID #Emp001
...........................
my website coderbaba.in
.............................
Thanks for watching my video hit like , subscribe our channel and don't forget to share with you friends
............................
Thanks for being with us make sure you share and stay with us with subscribing us - regards CODERBABA

.....................
Follow Us Socially :

Facebook :   / coderbaba  

Instagram :   / coderbaba  

Twitter :   / thecoderbaba  
............................


LIKE SHARE SUBSCRIBE

See you in next video, have a nice day.
GOOD LUCK