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

推荐订阅源

Martin Fowler
Martin Fowler
L
Lohrmann on Cybersecurity
罗磊的独立博客
V
V2EX
人人都是产品经理
人人都是产品经理
腾讯CDC
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
aimingoo的专栏
aimingoo的专栏
D
Docker
云风的 BLOG
云风的 BLOG
B
Blog
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Microsoft Azure Blog
Microsoft Azure Blog
C
Check Point Blog
IT之家
IT之家
S
Secure Thoughts
S
Security @ Cisco Blogs
博客园 - 聂微东
阮一峰的网络日志
阮一峰的网络日志
G
Google Developers Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
TaoSecurity Blog
TaoSecurity Blog
博客园_首页
雷峰网
雷峰网
博客园 - 三生石上(FineUI控件)
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
H
Heimdal Security Blog
Last Week in AI
Last Week in AI
Engineering at Meta
Engineering at Meta
D
DataBreaches.Net
J
Java Code Geeks
PCI Perspectives
PCI Perspectives
GbyAI
GbyAI
Help Net Security
Help Net Security
W
WeLiveSecurity
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
S
Schneier on Security
H
Hackread – Cybersecurity News, Data Breaches, AI and More
F
Full Disclosure
A
About on SuperTechFans
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Recorded Future
Recorded Future
C
CXSECURITY Database RSS Feed - CXSecurity.com
NISL@THU
NISL@THU
Hacker News: Ask HN
Hacker News: Ask HN
The Cloudflare Blog
Latest news
Latest news
The Last Watchdog
The Last Watchdog
Attack and Defense Labs
Attack and Defense Labs
T
The Blog of Author Tim Ferriss

博客园 - Amwpfiqvy

如何查看执行计划 SQL Server 堆表与栈表的对比(大表) SQL Server中CURD语句的锁流程分析 树表分级统计 SQL:查询购买了所有指定商品的人 在SQL Server中使用正则表达式 查看SQL Server性能时常用的性能计数器 SQL Server中行列转换 Pivot UnPivot Apq本地工具集 Apq.aspx 第一个:_Config.js JScript.Encode.js - Amwpfiqvy - 博客园 Apq.Threading.js - Amwpfiqvy - 博客园 Script/_Config.js Apq.Text.js Apq.js - Amwpfiqvy - 博客园 prototype.js Apq.aspx - Amwpfiqvy - 博客园 利用JScript的Literal Syntax特性用字符串表示对象
查看数据库所有用户表及其列信息
Amwpfiqvy · 2006-05-11 · via 博客园 - Amwpfiqvy

SELECT obj.object_id, obj.name table_name, c.column_id, c.name column_name, c.system_type_id, c.is_nullable, 
    c.is_identity, c.is_computed, ind.is_primary_key, c.max_length, 
    
COLUMNPROPERTY( c.object_id, c.[name]'Precision' ) Precision
    
ISNULLCOLUMNPROPERTY( c.object_id, c.[name]'Scale' ), 0 ) Scale, d.definition [Default] 
FROM sys.columns c 
    
INNER JOIN sys.objects obj on c.object_id = obj.object_id 
    
LEFT JOIN sys.default_constraints d on c.default_object_id = d.object_id 
    
LEFT JOIN sys.index_columns ic ON c.object_id = ic.object_id AND c.column_id = ic.column_id 
    
LEFT JOIN sys.indexes ind ON c.object_id = ind.object_id AND ic.index_id = ind.index_id 
WHERE obj.type LIKE 'U' 
    
--AND obj.[name] LIKE 'Log'    -- 需要查看某个表信息时添加此条件

注:仅适用于2005版本,因为2000的代码已有邹老师的标准版本,CSDN上一大把,故不累述。

以上代码参考邹老师为2000写的代码,查阅2005帮助后,列出一些较为实用的属性,其实sys.columns里还有很多有用的属性,但不是经常使用,故不列出,如有兴趣可以自行添加列名列出。