ITeye博客

sqlserver 中查询一个字段都在哪个表中

dky_rl · 2009-12-30 16:36 · Sql Server · 数据库 · Markdown

要在数据库中查找cost_center都在什么表中用到了, 首先用连接到要查找的数据库,不能用windows验证方式。

select * from syscolumns where name = 'cost_center'

查询出name 如下: 4195065 1698105090

把name 放到如下语句中执行: select * from sysobjects where id=4195065

结果中的name 就是要找的表了: VW_Employee

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。