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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With