IF OBJECT_ID ('dbo.RevisedBudgetExpense','V') IS NOT NULL DROP VIEW dbo.RevisedBudgetExpense
GO 
CREATE VIEW dbo.RevisedBudgetExpense
AS 
SELECT 
    ROW_NUMBER() OVER (
        ORDER BY 
            p.CompanyID, 
            p.ProjectID
    ) AS RowKey,
CompanyID, 
ProjectID, 
SUM(RevisedAmount) as RevisedAmount
from PMBudget p 
WHERE p.[Type] = 'E'
 group by p.CompanyID,
          p.ProjectID