How to find column names for all tables in all databases in SQL Server

前端 未结 13 615
被撕碎了的回忆
被撕碎了的回忆 2020-11-28 04:30

I want to find all column names in all tables in all databases. Is there a query that can do that for me? The database is Microsoft SQL Server 2000.

13条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-28 04:41

    Why not use

    Select * From INFORMATION_SCHEMA.COLUMNS
    

    You can make it DB specific with

    Select * From DBNAME.INFORMATION_SCHEMA.COLUMNS
    

提交回复
热议问题