CREATE PROCEDURE PreTest_36_UDFExistsInMarketingDocumentBPAddress() LANGUAGE SQLSCRIPT 
				AS 
			BEGIN
				SELECT * FROM CUFD T0, CUFD T1
				WHERE T0."TableID" = 'CRD1'
				AND T1."TableID" IN ('RDR12', 'POR12', 'INV12')
				AND T0."Sys" = 'N'
				AND T1."Sys" = 'N'
				AND (LOWER(T1."AliasID") = LOWER(concat(T0."AliasID", 'B')) or LOWER(T1."AliasID") = LOWER(concat( T0."AliasID", 'S')))
				AND EXISTS (SELECT 1 FROM CINF WHERE "Version" < 1000110);
			END;







