 IF  EXISTS (SELECT * FROM dbo.sysobjects WHERE id = OBJECT_ID(N'[dbo].[ENT_YBBYS_LABORATUVAR_KANGAZLARI_LISTESI]') AND OBJECTPROPERTY(id,N'IsVIew') = 1)
BEGIN
    INSERT INTO SCRIPT_BACKUPS (SCRIPTNAME,SCRIPT,SCRIPTDATE) SELECT 'ENT_YBBYS_LABORATUVAR_KANGAZLARI_LISTESI' SCRIPTNAME,OBJECT_DEFINITION(OBJECT_ID('ENT_YBBYS_LABORATUVAR_KANGAZLARI_LISTESI')) AS SCRIPT,GETDATE() AS SCRIPTDATE
    DROP VIEW ENT_YBBYS_LABORATUVAR_KANGAZLARI_LISTESI
END
go

CREATE VIEW  ENT_YBBYS_LABORATUVAR_KANGAZLARI_LISTESI 
AS
select * from ENT_YBBYS_LABORATUVAR_TETKIK_LISTESI  where SUTKODU='901920' 


/*
SELECT * FROM ENT_YBBYS_LABORATUVAR_KANGAZLARI_LISTESI WHERE KimlikEntegreReferansKodu=727686 and [HbysDosyaId]=3443343 
ORDER BY GIRISTARIH DESC, [KimlikEntegreReferansKodu], HTETKIKID,LSIRA,RAPORBASLIK, SIRANO
*/
