【发布时间】:2013-07-12 18:15:15
【问题描述】:
例如:
DECLARE
@t TABLE(id int),
@i int;
Msg 102, Level 15, State 1, Line 2
Incorrect syntax near ','.
但是使用单独的 DECLARE 语句可以正常工作
DECLARE @t TABLE(id int);
DECLARE
@i int,
@str varchar(10);
Command(s) completed successfully.
为什么会这样?表声明和“通常”变量的声明有什么区别?
【问题讨论】:
标签: sql-server-2008 tsql syntax sql-server-2012 declare