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

	DECLARE @CNT INT

	SELECT @CNT = COUNT(ROLE_ID)
	FROM ROLE
	WHERE ROLE_ID IN (
	'Design Engineer',
	'General Administrator',
	'None',
	'Observer',
	'Project Administrator',
	'Project Manager'
	)

	IF @CNT = 6
	BEGIN
		SET @STATUS = 0
		SET @MESSAGE = ''

	END
	ELSE
	BEGIN
		SET @STATUS = 1
		SET @MESSAGE = 'Standard Role(s) missing. Please check'
	END

	SELECT @STATUS, @MESSAGE

END

