我想像这样创建一个存储过程
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
请告诉我如何创建一个获取所有这些参数的存储过程。