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

	SELECT	@CNT = COUNT(*)
	FROM	DATASET
	WHERE	LEN(DSET_NAME) > 250

	IF @CNT > 0
	BEGIN
		SET @STATUS = 1
		SET @MESSAGE = 'File Name(s) with Length greater than 250 are detected.'
	END
	ELSE
	BEGIN
		SET @STATUS = 0
		SET @MESSAGE = ''
	END
	
	SELECT @STATUS, @MESSAGE
END

