我正在尝试从 EmployeeMaster 检索名称并插入 LeaveCarryForwardTemp .. 我写了这个查询.. 但它返回一个空值.. 请建议..
(
@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