且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在 SQL Server 数据库中查找特定列?

更新时间:2022-11-24 17:33:39

您可以查询数据库的 information_schema.columns 表,该表保存了数据库中定义的所有列的架构结构.

You can query the database's information_schema.columns table which holds the schema structure of all columns defined in your database.

使用此查询:

select * from information_schema.columns where column_name = 'ProductNumber'

结果将为您提供列:

TABLE_NAMETABLE_CATALOGDATA_TYPE 以及此数据库列的更多属性.

TABLE_NAME, TABLE_CATALOG, DATA_TYPE and more properties for this database column.