Case-1:
i think you supposed to select first_name, mid_name and last_name from front-end and then the corresponding employee_id should be inserted into AccidentTEST table...
If this is ur requirement, do as follows:
create procedure sp_InsertID
( @p_FirstName VARCHAR(30), --Mandatory
@p_MidName VARCHAR(30), --Optional
@p_LastName VARCHAR(30) --Mandatory
)
as
BEGIN
insert into [dbo].[AccidentTEST](EmployeeID)
select EmployeeID
from [dbo].[EmployeeTEST]
where CONCAT([FirstName],' ',COALESCE([MI],''),' ',[LastName]) = CONCAT(@p_FirstName,' ',COALESCE(@p_MidName,''),' ',@p_LastName)
END
Case-2:
According to ur code, what i unserstood is you have already first_name,mid_name and last_name in AccidentTEST table and you are trying to pull corresponding employee_id from EmployeeTEST table into AccidentTEST table. For this u have to do update but not insert
--
Chandu