CREATE PROCEDURE id_management
AS
BEGIN
DECLARE @SDOW DATETIME
DECLARE @COMBINE VARCHAR(300))
SET @COMBINE = (CONCAT(DealerAddMrv.CreationDate,DealerAddHist.mnmUserType,DealerAddMrv.mnmUserStatus,DeletedDealerAddHist.DelSourceUserId,DeletedDealerAddMrv.DelDtTime As AppID_Status))
SET @SDOW= (SELECT DATEADD(DAY, 2 - DATEPART(WEEKDAY, GETDATE()), CAST(GETDATE() AS DATE)))
PRINT @SDOW
SELECT UserInOut.mnmUser as AppID_ID,DealerAddMrv.mnmRole as AppID_Type,DealerAddMrv.mnmUserName
as AppID_Name,UserInOut.mnmUserAccessType as Access_Type,
DealerAddMrv.mnmUserName as AppID_Implemented_By
,'IND' as Access_Country,UserInOut.DtTime as AppID_Implemented_TimeStamp,DealerAddMrv.mnmUserStatus As AppID_Status,@COMBINE FROM "dbo"."UserInOut"
INNER JOIN "dbo"."DealerAddMrv"
on "DealerAddMrv"."mnmUser" = "UserInOut"."mnmUser"
INNER JOIN "dbo"."DealerAddHist"
on "DealerAddHist"."mnmUser" = "DealerAddMrv"."mnmUser"
INNER JOIN "dbo"."DeletedDealerAddHist"
on "DeletedDealerAddHist"."DelSourceUserId" = "DeletedDealerAddMrv"."DelSourceUserId"
order by "UserInOut"."mnmUser"
where UserInOut.DtTime >= @SDOW
END
GO
1条答案
按热度按时间zpqajqem1#
varchar(300)后面有多余的括号吗