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

	SELECT	@CNT = COUNT(*)
	FROM	SITE

	IF @CNT > 20
	BEGIN
		SET @STATUS = 1
		SET @MESSAGE = 'Sites are greater than 20 (Max allowed).'
	END
	ELSE
	BEGIN
		SET @STATUS = 0
		SET @MESSAGE = ''
	END
	
	SELECT @STATUS, @MESSAGE
END

