我想像
一样创建商店程序CREATE PROCEDURE [dbo].[uspGetApplicationsByLoginName]
@loginName
AS
VARCHAR(30)
--,@IsSuperAdmin as bit
AS
BEGIN
SELECT MA.appName,
MA.appId,
MA.CompatiableDeviceType,
MA.appShortCode,
MA.downloadAppUrl,
MA.CurrentVersion,
MAI.AppIconUrl,
MAI.SplashLogoUrl,
MAI.HeaderLogoUrl,
MM.moduleName
FROM mstApp MA
LEFT OUTER JOIN mstAppImages MAI
ON MAI.appId = MA.appId
LEFT OUTER JOIN trnAppModule TAM
ON TAM.appId = MA.appId
LEFT OUTER JOIN trnAppGroups TAG
ON TAG.appModuleId = TAM.appModuleId
LEFT OUTER JOIN mstModule MM
ON MM.moduleId = TAM.moduleId
WHERE TAG.loginName = 'kmg'
GO
请告诉我如何创建一个获取所有这些参数的商店程序。
答案 0 :(得分:0)
我想你只会改变这一行:
where TAG.loginName ='kmg'
要:
where TAG.loginName = @LoginName
然后你可以使用:
来调用它EXEC uspGetApplicationsByLoginName 'kmg'