IF  EXISTS (SELECT * FROM SYS.VIEWS WHERE OBJECT_ID = OBJECT_ID(N'[DBO].[V_BI_PG_FORN]'))
DROP VIEW [DBO].[V_BI_PG_FORN]    
GO
--SELECT * FROM V_BI_PG_FORN
CREATE VIEW V_BI_PG_FORN AS
SELECT
    CD_FORN AS Fornecedor,
	NM_FANT AS NmFornecedor,
	PG_TP_FORN.DS_TP as DsTipoForncedor,
	V_TP_FORN_CLASSIFICACAO.Classificacao
	
FROM
	PG_FORN INNER JOIN PG_TP_FORN ON
	PG_FORN.CD_TP_FORN = PG_TP_FORN.CD_TP_FORN
	INNER JOIN V_TP_FORN_CLASSIFICACAO ON
	PG_TP_FORN.TP_FORN = V_TP_FORN_CLASSIFICACAO.TP_FORN