EmployeeMasterから名前を取得してLeaveCarryForwardTempに挿入しようとしています。このクエリを作成しました。しかし、null値を返します。plsアドバイス..
(
@CreatedUserID as nvarchar(9)
,@CalendarYear as numeric(18, 0)
)
AS
BEGIN
Select
A.EmployeeID,B.Name as EmpName
From HRLeaveCarryForwardTemp A
Join HREmployeeMaster B On A.EmployeeID = B.EmployeeID
Where A.EmployeeID = B.EmployeeID
Delete dbo.HrLeaveCarryForwardTemp
Where UserID = @CreatedUserID
INSERT INTO [dbo].[HrLeaveCarryForwardTemp]
( [UserID]
,[EmployeeID]
,[CalendarYear]
,[LeaveCarryForward]
,[Status]
)
Select
@CreatedUserID
,[EmployeeID]
,@CalendarYear
,[LeaveCarryForward]
,[Status]
From dbo.[HRLeaveCarryForward]
Where CalendarYear =@CalendarYear
END