create table parent
(id int,name varchar(20))create table child
(id int,parentID int,childname varchar(20))
insert parent
select 1,'老张' union all
select 2,'老李'insert child
select 1,1,'张大' union all
select 2,1,'张二' union all
select 3,2,'李大'
go/*------------查找childname字段属于哪个表------------------*/
select name from sysobjects a where exists (
select * from syscolumns b where name='childname' and a.id=b.id)drop table parent,child/*----------结果---------*/
name                                         
------------------------------------
child(所影响的行数为 1 行)