我可以在数据库上运行什么查询,告诉我该数据库中哪些表有一个名为“RCPTNMBR”的列?
答案 0 :(得分:15)
大多数数据库都支持这一点:
SELECT
table_name
FROM
information_schema.columns
WHERE
column_name = 'x'
答案 1 :(得分:1)
试一试
SELECT t.name as TableName, c.name as ColumnName
FROM sys.tables t
JOIN sys.columns c ON t.object_id = c.object_id
WHERE c.name = 'RCPTNMBR'