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

	SET @STATUS = 0
	SET @MESSAGE = ''

	SELECT	@CNT = COUNT(*)
	FROM	FILE_IMAGES 
	WHERE	UPPER(THUMBNAIL_TYPE) NOT IN ('JPEG', 'PNG') 
	
	IF @CNT > 0
	BEGIN
		SET @STATUS = 1
		SET @MESSAGE = 'Thumbnails found with types other than JPEG and PNG.'
	END
	ELSE
	
	SELECT @STATUS, @MESSAGE
END

