-- SA. View for smart entities identification
USE [envisage]
Go

if exists (select * from sys.views where name='BLL_Objects')
begin
  drop view BLL_Objects
end
GO

CREATE VIEW [dbo].[BLL_Objects] AS
SELECT Id, 'Company' AS EntityName FROM Company
UNION ALL
SELECT Id, 'View' FROM [View]
UNION ALL
SELECT Id, 'Team' FROM Team
UNION ALL
SELECT Id, 'Resource' FROM PeopleResource
GO 
