Hi friends
i am auto generating an employee id in sql server, but i didnt just wana use identity to generate it in the 1,2,3.... Sequence i want it in a format like this Emp00001 so decided to manipulate my code
here is my code to create the table
Create table employee ( ID int identity, EmployeeID as (('Emp') + replicate ('0', 8 - Len(ID)) + Cast (ID as Varchar)) persisted Primary Key, FirstName Varchar(50) not null, LastName Varchar(50) not null)
but the problem am having with this code is that after creating the table, sql server pops up two warnings that got me realy worried
here are the warnings:
Warning! The maximum key length is 900 bytes. The index 'PK_Employee_1A89E4E1' has maximum length of 800 bytes. For some combination of large values, the insert/update operation will fail.
Warning: The maximum length of the row exceeds the permissible limit of 8060 bytes. For some combination of large values, the insert/update operation will fail.
is the code i used good, or is not a good practice please i need sugestions
thanks