如何声明和初始化表变量? 类似如下的语句,正确的写法是什么?谢谢declare @t tableset t= (select id, name from t2)table初始化 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 declare @t table(id int,[name] varchar(100))insert into @t select id,[name] from tbselect * from @t declare @t table(id int,name varchar(10)) --这里insert into @t(id,name)select id,name from t2 --那就成临时表了,表变量需要声明select *into #tbfrom tb MyODBC连接问题 sql sa帐号权限问题 SQL server2005如何恢复数据库? 生产进度报表查询问题 数据统计 请教“主键—外键”的数据表 求救!!简单的程序问题,在线等! 动态报表的格式问题 一个数据库问题 sql server中这个存储过程如何写? 存储过程如何调用其他存储过程 SQL2008数据库损毁怎样还原数据
insert into @t select id,[name] from tb
select * from @t
select id,name from t2
--那就成临时表了,表变量需要声明
select *
into #tb
from tb