简体   繁体   English

存储过程声明T-SQL中的嵌套创建类型

[英]Nested Create Type in Stored Procedure Declaration T-SQL

I am writing a SQL Stored Proc which takes in a single table valued parameter. 我正在编写一个SQL Stored Proc,它接受一个表值参数。 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
)

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. 在将数据指定为参数类型之前,数据库将希望该类型已存在,否则数据库无法知道它接收的数据是否有效。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM