0

我想像这样创建一个存储过程

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

请告诉我如何创建一个获取所有这些参数的存储过程。

4

1 回答 1

0

我想你会改变这一行:

where TAG.loginName ='kmg'

至:

where TAG.loginName = @LoginName

然后您可以使用以下方法调用它:

EXEC uspGetApplicationsByLoginName 'kmg'
于 2013-09-12T13:22:52.277 回答