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

推荐订阅源

T
Threatpost
Hacker News: Ask HN
Hacker News: Ask HN
C
Cisco Blogs
P
Privacy & Cybersecurity Law Blog
C
CERT Recently Published Vulnerability Notes
P
Palo Alto Networks Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
Lohrmann on Cybersecurity
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
S
Securelist
N
News | PayPal Newsroom
I
Intezer
H
Hacker News: Front Page
P
Privacy International News Feed
Recent Commits to openclaw:main
Recent Commits to openclaw:main
G
GRAHAM CLULEY
A
About on SuperTechFans
P
Proofpoint News Feed
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Project Zero
Project Zero
Cloudbric
Cloudbric
N
News and Events Feed by Topic
大猫的无限游戏
大猫的无限游戏
Attack and Defense Labs
Attack and Defense Labs
博客园 - 叶小钗
S
Security @ Cisco Blogs
L
LINUX DO - 最新话题
月光博客
月光博客
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
S
SegmentFault 最新的问题
博客园 - Franky
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
GbyAI
GbyAI
Google DeepMind News
Google DeepMind News
I
InfoQ
有赞技术团队
有赞技术团队
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园_首页
Microsoft Azure Blog
Microsoft Azure Blog
S
Security Affairs
Apple Machine Learning Research
Apple Machine Learning Research
腾讯CDC
Security Archives - TechRepublic
Security Archives - TechRepublic
V
Vulnerabilities – Threatpost
T
The Blog of Author Tim Ferriss
Scott Helme
Scott Helme

博客园 - 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里还有很多有用的属性,但不是经常使用,故不列出,如有兴趣可以自行添加列名列出。