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

推荐订阅源

cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
博客园_首页
M
MIT News - Artificial intelligence
月光博客
月光博客
WordPress大学
WordPress大学
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
D
Docker
阮一峰的网络日志
阮一峰的网络日志
L
LangChain Blog
Engineering at Meta
Engineering at Meta
Last Week in AI
Last Week in AI
Vercel News
Vercel News
MyScale Blog
MyScale Blog
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Martin Fowler
Martin Fowler
U
Unit 42
Stack Overflow Blog
Stack Overflow Blog
A
About on SuperTechFans
The Register - Security
The Register - Security
B
Blog
Recorded Future
Recorded Future
J
Java Code Geeks
Recent Announcements
Recent Announcements
Microsoft Security Blog
Microsoft Security Blog
H
Help Net Security
F
Fortinet All Blogs
B
Blog RSS Feed
Project Zero
Project Zero
The Hacker News
The Hacker News
T
Threatpost
D
Darknet – Hacking Tools, Hacker News & Cyber Security
L
LINUX DO - 热门话题
Jina AI
Jina AI
宝玉的分享
宝玉的分享
云风的 BLOG
云风的 BLOG
AWS News Blog
AWS News Blog
G
Google Developers Blog
GbyAI
GbyAI
S
Securelist
T
Tenable Blog
博客园 - 【当耐特】
Security Latest
Security Latest
人人都是产品经理
人人都是产品经理
T
Tor Project blog
Latest news
Latest news
P
Proofpoint News Feed
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里还有很多有用的属性,但不是经常使用,故不列出,如有兴趣可以自行添加列名列出。