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

推荐订阅源

AI
AI
TaoSecurity Blog
TaoSecurity Blog
H
Heimdal Security Blog
Help Net Security
Help Net Security
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Microsoft Azure Blog
Microsoft Azure Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Google DeepMind News
Google DeepMind News
爱范儿
爱范儿
The Cloudflare Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
人人都是产品经理
人人都是产品经理
大猫的无限游戏
大猫的无限游戏
N
News | PayPal Newsroom
V2EX - 技术
V2EX - 技术
博客园 - 【当耐特】
D
Darknet – Hacking Tools, Hacker News & Cyber Security
S
Secure Thoughts
C
CERT Recently Published Vulnerability Notes
罗磊的独立博客
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
P
Privacy & Cybersecurity Law Blog
有赞技术团队
有赞技术团队
S
Schneier on Security
S
SegmentFault 最新的问题
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
The Last Watchdog
The Last Watchdog
Schneier on Security
Schneier on Security
PCI Perspectives
PCI Perspectives
IT之家
IT之家
Project Zero
Project Zero
博客园 - 司徒正美
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Jina AI
Jina AI
Security Latest
Security Latest
Hacker News - Newest:
Hacker News - Newest: "LLM"
腾讯CDC
C
CXSECURITY Database RSS Feed - CXSecurity.com
阮一峰的网络日志
阮一峰的网络日志
C
Check Point Blog
aimingoo的专栏
aimingoo的专栏
V
Vulnerabilities – Threatpost
W
WeLiveSecurity
NISL@THU
NISL@THU
Webroot Blog
Webroot Blog
N
Netflix TechBlog - Medium
L
Lohrmann on Cybersecurity

博客园 - jierry

ASP.NET2.0控件一览---标准控件(2) ASP.NET2.0控件一览---标准控件(1) 控件开发时两种JS嵌入资源方式的使用 - jierry - 博客园 Flash Control for ASP.NET 2.0-Include Flash movies in your aspx pages 为DataGrid创建自定义列控件(四) 为DataGrid创建自定义列控件(三) - jierry - 博客园 为DataGrid创建自定义列控件(二) 为DataGrid创建自定义列控件(一) (转)SQLServer和Oracle的常用函数对比 《Effective C#》读书笔记(4) 《Effective C#》读书笔记(3) 《Effective C#》读书笔记(2) 《Effective C#》读书笔记(1) 选择合适的数据控件 自带图层的链接控件(DKLinks 1.0.0.323 ) 关于CodeBuild V3.0的一些想法 小工具:SQL存储过程解密修改工具 交叉表应用-成绩统计 现在提供第一版的存储过程生成器下载,欢迎大家试用
T-SQL tips(1)临时表和表变量
jierry · 2006-03-06 · via 博客园 - jierry

基本原则:能用表变量就用表变量。实在不行才使用临时表。
如与动态语句结合、外部需要使用等,就需要临时表

表变量主要开销系统的内存,而临时表则使用tempdb。对于小数据量的中间数据存储,可以使用表变量,而当需要临时保存的数据量很庞大时,建议使用临时表。具体使用表变量还是临时表,可以根据系统的运行状况来调整。

declare @tb table(id int,name varchar(50),age int--创建表变量

insert @tb select 1,'nn',14
union all select 1,'nn',14

select * from @tb




create table #t(id int,name varchar(50),years int,nums int)--创建临时表

insert #t select 1,'nn',14,15
union all select 1,'nn',14,15
insert into #t  exec sp_gets  --可以用于存储过程或动态SQL结合

select * from #t
drop table #t