3

I am writing a SQL Stored Proc which takes in a single table valued parameter. Is it possible for me to create the table type in the parameter definition, for example:

CREATE PROCEDURE example (
  @param (CREATE TYPE tableparameter ( column1 int, colunn2 varchar.... )) READONLY
)

1 Answer 1

3

No.
Databases will want the type to already exist before it can be specified as a parameter type, otherwise the database has no way to know if the data it is receiving is valid or not.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.