--EXEC MIG_VALIDATE_FILE_NAME_Sp '', ''
CREATE OR ALTER PROCEDURE MIG_VALIDATE_FILE_TYPE_Sp
(
	@STATUS INT = 0 OUT,
	@MESSAGE NVARCHAR(999) = NULL OUT
)
AS 
BEGIN
	DECLARE @CNT INT

	SET @STATUS = 0
	SET @MESSAGE = ''

	SELECT	@CNT = COUNT(*)
	FROM	DATASET 
	WHERE OBJECT_TYPE NOT IN ('12', '14') 
	
	IF @CNT > 0
	BEGIN
		SET @STATUS = 1
		SET @MESSAGE = 'File records found with type other than 12 (File) and 14 (EO Comment).'
	END
	ELSE
	
	SELECT @STATUS, @MESSAGE
END

