I am new to table-value in SQL Server 2008. I tried to create a custom table with the query
USE [DB_user]
GO
CREATE TYPE [dbo].[ApproveAddsIds] AS TABLE(
[Ids] [bigint] NULL
)
GO
When I tried to use a table type in a stored procedure
USE [DB_user]
GO
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
create PROCEDURE [dbo].[GetTopTopic]
@dt [dbo].[ApproveAddsIds] READONLY
AS
BEGIN
END
I got two errors:
@dt has an invalid data type.
The @dt parameter cannot be read-only because it is not a table parameter.
So, I tried to find out the reason for this, since the first request was successfully completed. I thought he was due to permissions and therefore tried
GRANT EXEC ON TYPE::[schema].[typename] TO [User]
GO
But the error continues, I do not know what the problem is.
- , , @dt [dbo].[ApproveAddsIds] READONLY , AS . , . , .