惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

腾讯CDC
博客园 - Franky
MyScale Blog
MyScale Blog
L
LangChain Blog
Martin Fowler
Martin Fowler
Recent Announcements
Recent Announcements
Stack Overflow Blog
Stack Overflow Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 司徒正美
量子位
A
About on SuperTechFans
C
Check Point Blog
大猫的无限游戏
大猫的无限游戏
Last Week in AI
Last Week in AI
小众软件
小众软件
Apple Machine Learning Research
Apple Machine Learning Research
I
InfoQ
V
Visual Studio Blog
Vercel News
Vercel News
B
Blog
爱范儿
爱范儿
aimingoo的专栏
aimingoo的专栏
U
Unit 42

博客园 - microtea

Jmeter多机联合产生负载 (转) 【转载】关于Java文件路径问题 - microtea - 博客园 安装CVSNT UTF-8的繁体与简体转换 - microtea - 博客园 利用MSSQL sp自制未公开的加密函数(转) wap开发的点小经验 no suitable driver java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC][SQLServer]对象名 'xxx' 无效 java的对像克隆 在Redhat9上安装Oracle 9.2 SQL中的单记录函数 常用javascript Java:int 和 String 互相转换的多种方法 JAVA:Duplicate name in Manifest: Class-Path 关于The underlying connection was closed ServerVariables 集合环境变量列表 初步的对防盗连接的方法的设想 在asp.net中对web.config内容的添加 Asp.net(C#)中基于Forms验证的角色(用户组)验证授权过程
关于临时表的个人经验 - microtea - 博客园
microtea · 2005-11-04 · via 博客园 - microtea

临时表有两种,一种是全局的,用"##"开头,当前用同一帐号登录的所有会话可见,如:##temptable;
还有一种是局部,只用当前会话可见,用"#"开头,如:#temptable;
两种表其实是相当相像的;

/* making ##temp table*/
select * into ##temptable from table

/* making #temp table*/
select * into #temptable from table

/* drop ##temp table */
if exists(select * from tempdb.dbo.sysobjects where name='##temptable')
begin
drop table ##temptable
end

/* drop #temp table */
if object_id('tempdb..#temptable') is not null
begin
drop table #temptableA
end

注意:如果用exec (sqltring)方法建立的局部临时表,那是在sqltring外不可以见的