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

推荐订阅源

S
SegmentFault 最新的问题
博客园 - 三生石上(FineUI控件)
爱范儿
爱范儿
博客园 - 聂微东
V
Visual Studio Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
M
MIT News - Artificial intelligence
The GitHub Blog
The GitHub Blog
Recent Announcements
Recent Announcements
有赞技术团队
有赞技术团队
L
LangChain Blog
I
InfoQ
T
Tailwind CSS Blog
博客园 - 【当耐特】
V
V2EX
博客园_首页
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
GbyAI
GbyAI
Vercel News
Vercel News
雷峰网
雷峰网
量子位
A
About on SuperTechFans
Martin Fowler
Martin Fowler
H
Help Net Security

博客园 - Charie

牛郎与织女的故事 给22岁自己的回信 所谓运气 一转眼最早的文章都20年前了,真吓人 wireshark解密本地https流量笔记 debian+apache+acme_tiny+lets-encrypt配置笔记 团队组建的一些想法 哈哈一下 好久不来了,过来锄草 DNS反射攻击阻止 北漂中~ 从来没有谁与谁是一路人,我们爱的往往是自己的幻想 不要跟亲戚谈生意 做一个严格要求自己的人 人类未来进化方向恶考 mysql 列所有表行数 恩,有那么一个人 00后厉害哇 。。。。 放弃微博,继续回来写月经
mssql表名列名对应语句
Charie · 2014-04-16 · via 博客园 - Charie
if exists (select * from tempdb..sysobjects where name like '#magic%')
drop table #magic
go
select a.name name,b.name col,c.name type 
into #magic 
from sysobjects a,syscolumns b,systypes c
where a.xtype = 'U' 
and a.id = b.id 
and b.xtype = c.xtype 
and b.xusertype = c.xusertype

--将结果加工
select (case when tmp3.no=1 then tmp3.name else ' ' end) name,col,type 
from 
(select top 100000000 name
 ,(select count(1) from #magic tmp1 
   where tmp1.name=tmp2.name 
   and tmp1.col<=tmp2.col) as no,col,type
   from #magic tmp2 
   order by name,col,type) 
tmp3

做个笔记