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

	-------- ITEM.STRING1 --------
	SELECT @CNT = COUNT(*)
	FROM ITEM 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(ITEM.STRING1) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'ITEM.STRING1'
		END

	-------- ITEM.STRING2 --------
	SELECT @CNT = COUNT(*)
	FROM ITEM 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(ITEM.STRING2) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'ITEM.STRING2'
		END

	-------- ITEM.STRING3 --------
	SELECT @CNT = COUNT(*)
	FROM ITEM 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(ITEM.STRING3) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'ITEM.STRING3'
		END

	-------- ITEM.STRING4 --------
	SELECT @CNT = COUNT(*)
	FROM ITEM 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(ITEM.STRING4) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'ITEM.STRING4'
		END

	-------- ITEM.STRING5 --------
	SELECT @CNT = COUNT(*)
	FROM ITEM 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(ITEM.STRING5) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'ITEM.STRING5'
		END

	-------- ITEM.STRING6 --------
	SELECT @CNT = COUNT(*)
	FROM ITEM 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(ITEM.STRING6) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'ITEM.STRING6'
		END

	-------- DOC.STRING1 --------
	SELECT @CNT = COUNT(*)
	FROM DOC 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DOC.STRING1) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DOC.STRING1'
		END

	-------- DOC.STRING2 --------
	SELECT @CNT = COUNT(*)
	FROM DOC 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DOC.STRING2) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DOC.STRING2'
		END

	-------- DOC.STRING3 --------
	SELECT @CNT = COUNT(*)
	FROM DOC 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DOC.STRING3) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DOC.STRING3'
		END

	-------- DOC.STRING4 --------
	SELECT @CNT = COUNT(*)
	FROM DOC 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DOC.STRING4) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DOC.STRING4'
		END

	-------- DOC.STRING5 --------
	SELECT @CNT = COUNT(*)
	FROM DOC 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DOC.STRING5) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DOC.STRING5'
		END

	-------- DOC.STRING6 --------
	SELECT @CNT = COUNT(*)
	FROM DOC 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DOC.STRING6) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DOC.STRING6'
		END


	-------- FOLDER.STRING1 --------
	SELECT @CNT = COUNT(*)
	FROM FOLDER 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(FOLDER.STRING1) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'FOLDER.STRING1'
		END

	-------- FOLDER.STRING2 --------
	SELECT @CNT = COUNT(*)
	FROM FOLDER 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(FOLDER.STRING2) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'FOLDER.STRING2'
		END

	-------- FOLDER.STRING3 --------
	SELECT @CNT = COUNT(*)
	FROM FOLDER 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(FOLDER.STRING3) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'FOLDER.STRING3'
		END

	-------- FOLDER.STRING4 --------
	SELECT @CNT = COUNT(*)
	FROM FOLDER 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(FOLDER.STRING4) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'FOLDER.STRING4'
		END

	-------- FOLDER.STRING5 --------
	SELECT @CNT = COUNT(*)
	FROM FOLDER 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(FOLDER.STRING5) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'FOLDER.STRING5'
		END


	-------- DATASET.DSET_NAME --------
	SELECT @CNT = COUNT(*)
	FROM DATASET 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DATASET.DSET_NAME) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DATASET.DSET_NAME'
		END

	-------- DATASET.STRING1 --------
	SELECT @CNT = COUNT(*)
	FROM DATASET 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DATASET.STRING1) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DATASET.STRING1'
		END

	-------- DATASET.STRING2 --------
	SELECT @CNT = COUNT(*)
	FROM DATASET 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DATASET.STRING2) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DATASET.STRING2'
		END

	-------- DATASET.STRING3 --------
	SELECT @CNT = COUNT(*)
	FROM DATASET 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DATASET.STRING3) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DATASET.STRING3'
		END

	-------- DATASET.STRING4 --------
	SELECT @CNT = COUNT(*)
	FROM DATASET 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DATASET.STRING4) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DATASET.STRING4'
		END

	-------- DATASET.STRING5 --------
	SELECT @CNT = COUNT(*)
	FROM DATASET 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(DATASET.STRING5) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'DATASET.STRING5'
		END

	-------- EO.STRING1 --------
	SELECT @CNT = COUNT(*)
	FROM EO 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(EO.STRING1) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'EO.STRING1'
		END

	-------- EO.STRING2 --------
	SELECT @CNT = COUNT(*)
	FROM EO 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(EO.STRING2) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'EO.STRING2'
		END

	-------- EO.STRING3 --------
	SELECT @CNT = COUNT(*)
	FROM EO 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(EO.STRING3) = 1
	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'EO.STRING3'
		END

	-------- EO.STRING4 --------
	SELECT @CNT = COUNT(*)
	FROM EO 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(EO.STRING4) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'EO.STRING4'
		END

	-------- EO.STRING5 --------
	SELECT @CNT = COUNT(*)
	FROM EO 
	WHERE dbo.MIG_CONTAINS_HIGH_ASCII_CHARS_Fn(EO.STRING5) = 1

	IF @CNT > 0
		BEGIN
			SET @STATUS = 1
			IF @MESSAGE IS NULL
				SET @MESSAGE = ''
			ELSE
				SET @MESSAGE = @MESSAGE  + ', '

			SET @MESSAGE = @MESSAGE + 'EO.STRING5'
		END


	-----------------------------
	IF @MESSAGE IS NOT NULL
		SET @MESSAGE = 'Fields with high-ascii characters: ' + @MESSAGE
	-----------------------------

	SELECT @STATUS, @MESSAGE
	-----------------------------
END