T-SQL List Tables, Columns

前端 未结 2 1891
隐瞒了意图╮
隐瞒了意图╮ 2021-02-02 08:57

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 constrai

2条回答
  •  不知归路
    2021-02-02 09:36

    Please check out the information schema.

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

提交回复
热议问题