IF EXISTS (SELECT * FROM SYSOBJECTS O, SYSUSERS U
           WHERE
           O.NAME = 'TIPOCTRECEPROD' AND
	   TYPE = 'V' 		  AND
	   U.UID = O.UID          AND
	   U.NAME = USER)

   DROP VIEW TIPOCTRECEPROD
GO

CREATE VIEW TIPOCTRECEPROD AS
SELECT CDPRODUTO, CDTPCTRECEB, CDARVPROD
FROM PRODUTO
WHERE CDTPCTRECEB IS NOT NULL
GO

