您的位置:首页 > 数据库

SQL创建临时表

2017-09-19 08:17 302 查看
创建临时表

方法一:

create table #临时表名(字段1 约束条件,

字段2 约束条件,

…..)

create table ##临时表名(字段1 约束条件,

字段2 约束条件,

…..)

方法二:

select * into #临时表名 from 你的表;

select * into ##临时表名 from 你的表;

注:以上的#代表局部临时表,##代表全局临时表

查询临时表

select * from #临时表名;

select * from ##临时表名;

删除临时表

drop table #临时表名;

drop table ##临时表名;

SQL SERVER临时表的使用

http://www.cnblogs.com/shineqiujuan/archive/2008/11/13/1332657.html
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: