在SQL Server中,如何查询数据库以恢复具有特定名称字段的所有表?

===============>>#1 票数:7 已采纳

以下查询将返回一个唯一的表列表,其中Column_Name等于您要查找的列:

SELECT Table_Name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE Column_Name = 'Desired_Column_Name'
GROUP BY Table_Name

===============>>#2 票数:0

SELECT Table_Name
FROM Information_Schema.Columns
WHERE Column_Name = 'YourFieldName'

===============>>#3 票数:0

我老了:

SELECT DISTINCT object_name(id)
FROM syscolumns
WHERE name = 'FIELDNAME'

  ask by Dan translate from so

未解决问题?本站智能推荐: