tsql 为什么不能不能将表变量直接进行付值,复制引用

declare @table1 as table
declare @table2 as table
不能直接进行付值吗?@table1=@table2
临时表直接能这样付值吗?复制引用?
[121 byte] By [lilei527-我看见,我听见] at [2008-1-9]
# 1
SQL里面是没有这样的操作的,还从来没有看过定义table变量的
NoThiNg2050-子虚乌有 at 2007-10-18 > top of Msdn China Tech,MS-SQL Server,基础类...
# 2
--try

declare @t1 table(ID int)
insert @t1 select 1
insert @t1 select 2
insert @t1 select 3

select * from @t1

declare @t2 table(ID int)
insert @t2 select * from @t1

select * from @t2
marco08-天道酬勤 at 2007-10-18 > top of Msdn China Tech,MS-SQL Server,基础类...
# 3
sql 表变量没有 直接复制的
xiaoku-野蛮人-v at 2007-10-18 > top of Msdn China Tech,MS-SQL Server,基础类...
# 4
赫赫,原来是这么回事:)
# 5
to:xiaoku
这么晚还没有睡觉呢?
# 6
declare @table1 as table --不能这么使用的
declare @table2 as table --正确使用:declare @table1 table(id int ,name varchar(10))
不能直接进行付值吗?@table1=@table2 --应该使用 insert into @table2 select * from @table1
xiaoku-野蛮人-v at 2007-10-18 > top of Msdn China Tech,MS-SQL Server,基础类...
# 7
呵呵。。。今天精神比较好
xiaoku-野蛮人-v at 2007-10-18 > top of Msdn China Tech,MS-SQL Server,基础类...
# 8
当心身体啊~哥们~~~~~~~~
# 9
表变量根临时表有什么区别?