Link to home
Start Free TrialLog in
Avatar of Vikash p
Vikash p

asked on

Auto Increment field in SQL server

Hi ,

I need to have a primary key field and a not null unique field  with auto increment by 1 .
with below format for field 1 . AB0000001 where AB will be prefix and is of 10 digit length.

and second filed CD00000001 with CD as prefix and 10 charater length. Both need to have auto increment by 1 every time user enters data.

What are the best solution for this ? I have SQL SERVER 2008 Express R2 installed
SOLUTION
Avatar of COACHMAN99
COACHMAN99

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Avatar of lcohan
lcohan
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial