Sivakumar

Sivakumar

  • NA
  • 551
  • 219.5k

How to get count of values in stored procedure

Mar 8 2016 1:51 AM
Hi,
 
I want to get count of Job status like count of  open,count of closed jobs and count of processing jobs 
 
This is my procedure :
 
USE [SmartJob
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
ALTER PROC [dbo].[GetJobStatus]
@CompanyID INT
AS
BEGIN
SELECT [StatusID]
,M.Value 'Status' FROM Jobs J
JOIN Master M ON M.MasterID=J.StatusID
WHERE CompanyID=@CompanyID;
END
 
 
 
Please help me 
 

Answers (4)