The following stored procedure parses if I leave the AppCount and @AppCount variables out but gives me "Incorrect syntax near the keyword 'As'". At first I didn't have an Output variable for AppCount because I don't need to pass it. I need to pass AppID and AppName to a detail oriented stored procedure. This is just a summary. Can you help me with these lines:CREATE PROCEDURE sp_InstalledAppNamesAndCounts -- Add the parameters for the stored procedure here @AppID Varchar(255) OUTPUT, @AppName Varchar(255) OUTPUT, @AppCount Varchar(255) OUTPUTASBEGIN -- SET NOCOUNT ON added to prevent extra result sets from -- interfering with SELECT statements. SET NOCOUNT ON; -- Insert statements for procedure here SELECT @AppID = v_CommonApp.AppID , @AppName = v_CommonApp.AppName , @AppCount = (COUNT(v_SMSAppdata.appID)) AS CountOfApps FROM v_CommonApp LEFT JOIN v_SMSAppData ON v_SMSAppData.appID = v_CommonApp.AppID GROUP BY v_CommonApp.AppName HAVING COUNT(v_SMSAppData.AppID) > 0 ORDER BY v_CommonApp.AppName ENDGO
The error occurs on the red line. I have eliminated the parentheses and moved them around to no effect. Thank you if you can help me.Duane