﻿IF EXISTS (
  SELECT name
  FROM sys.sysusers
  WHERE NAME = N'kreta')
BEGIN
  GRANT EXECUTE ON sp_Global_DeleteViews TO kreta;
  GRANT EXECUTE ON sp_Global_CreateSchemaViews TO kreta;
END

IF EXISTS (
  SELECT name
  FROM sys.sysusers
  WHERE NAME = N'kreta_db_user')
BEGIN
  GRANT EXECUTE ON sp_Global_DeleteViews TO kreta_db_user;
  GRANT EXECUTE ON sp_Global_CreateSchemaViews TO kreta_db_user;
END
GO
