我想自定义一个表类型,用于返回存储过程的结果集
create type CostomerType as Type
(
id int primary key not null,
name varchar(10)
)如上sql脚本,但在执行时报错
消息 156,级别 15,状态 1,第 2 行
关键字 'as' 附近有语法错误。请各位多多指教,有没有曾经用过表类型的例子?
create type CostomerType as Type
(
id int primary key not null,
name varchar(10)
)如上sql脚本,但在执行时报错
消息 156,级别 15,状态 1,第 2 行
关键字 'as' 附近有语法错误。请各位多多指教,有没有曾经用过表类型的例子?
Declare @user Table
(
ID INT,
NAME NVARCHAR(15)
)Insert INTO @table(ID,NAME) VALUES(....)数据库有这个类型的。
declare @T Table(列定义)
id int primary key not null,
name varchar(10)
)
GO
http://msdn.microsoft.com/zh-cn/library/bb522526.aspx