createprocedure[dbo].[MssWebGetOrderThirdPartyErrorsCount] @inOrderidint as begin setnocounton; selectcount(ThirdPartyErrors.Id) fromGetOrderThirdPartyErrors(@inOrderId)asThirdPartyErrors end GO GRANTEXECUTEON[dbo].[MssWebGetOrderThirdPartyErrorsCount]TO[MssExec] GO