Hi, I've been given my first task to create a stored procedure that creates a unique id number of an employee. The id number will be created from the first three letters of the employees last name, the first letter of the first name, and a sequential three digit number starting with zero. This stored procedure will be embeded in another stored procedure that will be inserting an employee into a table. Honestly, I am determined to get this, but I am looking for a little direction on were to start. I have this so far:
AS BEGIN SET NOCOUNT OFF Declare @uniqueid varchar(100)
Set @uniqueid = SUBSTRING(@lastname_vc, 1,3) + SUBSTRING(@firstname_vc,1,1)
SELECT @uniqueid //now I need to get a sequential number starting with 000 and append it to my letters. Thank you for bringing up the fact about two letter sir names?
answered Apr 10, 2013 at 03:30 PM