T-SQL 列表表、列 [英] T-SQL List Tables, Columns

查看:34
本文介绍了T-SQL 列表表、列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 T-SQL (SQL Server 2000) 中.如何列出数据库中的所有表和列?此外,在单独的查询中,有没有办法列出所有列以及数据类型和约束(NULLS 等).谢谢.

In T-SQL (SQL Server 2000). How can I list all tables and columns in a database? Also, in a separate query is there a way to list all columns along with data type and constraints (NULLS, etc). Thanks.

推荐答案

请查看 信息架构.

select *
from MyDatabaseName.information_schema.columns
order by table_name, ordinal_position

这篇关于T-SQL 列表表、列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆