8

I know it is possible to create a stored procedure and pass a TABLE as parameter by doing the following:

CREATE TYPE MyTableType AS TABLE (Id UNIQUEIDENTIFIER)

CREATE PROCEDURE MyProcedure
    @ids MyTableType READONLY
AS
...

I don't want to create a TYPE as above, because I was told to not create type dependencies in the database. So I want to do the following:

CREATE PROCEDURE MyProcedure
    @ids TABLE (Id UNIQUEIDENTIFIER)
AS

But for some reason I get error highlights. Am I doing something wrong in the syntax? Or is this not possible to do?

Mari Faleiros
  • 898
  • 9
  • 24

1 Answers1

5

I don't think it's possible to declare a table type inline like you're trying to do. The first line in this article on table-valued parameters says:

Table-valued parameters are declared by using user-defined table types.

Joe Farrell
  • 3,502
  • 1
  • 15
  • 25