msg 137,级别15,状态2,过程id\u管理,第13行必须声明标量变量“@combine”

iklwldmw  于 2021-07-26  发布在  Java
关注(0)|答案(1)|浏览(310)
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
zpqajqem

zpqajqem1#

varchar(300)后面有多余的括号吗

相关问题