USE XXX
GO
IF EXISTS(SELECT 1 FROM sys.types WHERE NAME = N'StatusIdList' and is_table_type = 1)
DROP TYPE [dbo].[StatusIdList]
GO
CREATE TYPE DBO.StatusIdList AS TABLE (StatusId INT)
GO
GRANT EXECUTE ON TYPE::[dbo].StatusIdList TO XXX
GO
USE XXX
GO
IF EXISTS(SELECT 1 FROM sys.types WHERE NAME = N'StatusIdList' and is_table_type = 1)
DROP TYPE [dbo].[StatusIdList]
GO
CREATE TYPE DBO.StatusIdList AS TABLE (StatusId INT)
GO
GRANT EXECUTE ON TYPE::[dbo].StatusIdList TO XXX
GO