use 数据库名
select * from syscolumns
where name = '###' --###字段名称 记住这个查询出来的id
select * from sysobjects
where id=123 -- 这个123就是上一个查询出来的id 查询结果中的name字段就是表名
或
select * from sysobjects
where id in (select id from syscolumns where name = '###') ###为字段名 --查询结果中name字段就是表名
本文介绍了如何使用SQL查询特定字段所在的数据表,通过两步查询实现精确查找。首先查询字段ID,再利用该ID找出对应的表名。
950

被折叠的 条评论
为什么被折叠?



