Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Nested Create Type in Stored Procedure Declaration T-SQL

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
)
like image 640
user378465 Avatar asked May 30 '26 18:05

user378465


1 Answers

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.

like image 180
OMG Ponies Avatar answered Jun 02 '26 11:06

OMG Ponies