/****** Object:  View [dbo].[V_BI_FUNCIONARIOS]    Script Date: 04/11/2013 10:05:53 ******/
IF  EXISTS (SELECT * FROM sys.views WHERE object_id = OBJECT_ID(N'[dbo].[V_BI_FUNCIONARIOS]'))
DROP VIEW [dbo].[V_BI_FUNCIONARIOS]
GO
--SELECT * FROM V_BI_FUNCIONARIOS
CREATE VIEW V_BI_FUNCIONARIOS
AS
SELECT
CD_FUN AS CdFuncionario,
NM_FUN AS NomeFuncionario,
DS_CARGO AS Cargo
FROM
FP_FUNC INNER JOIN FP_CARGO ON
FP_FUNC.CD_EMP = FP_CARGO.CD_EMP AND
FP_FUNC.CD_CARGO = FP_CARGO.CD_CARGO
UNION ALL
SELECT
0 AS CdFuncionario,
'NAO DEFINIDO' AS NomeFuncionario,
'NAO DEFINIDO' AS Cargo