`
dky_rl
  • 浏览: 67025 次
  • 性别: Icon_minigender_1
  • 来自: 黑龙江
社区版块
存档分类
最新评论

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

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



select * from  syscolumns
where name = 'cost_center'

查询出name 如下:
4195065
1698105090

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

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



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics