[sql server]
select name,case when xtype='u' then 'usertable' else 'userview' end as xtype
from sysobjects
where id in (
select id from syscolumns where name in('商品编号','商品名称')
) and (xtype='u' or xtype='v')
order by xtype
select name,case when xtype='u' then 'usertable' else 'userview' end as xtype
from sysobjects
where id in (
select id from syscolumns where name in('商品编号','商品名称')
) and (xtype='u' or xtype='v')
order by xtype
本文介绍了一个SQLServer中的查询示例,该查询从sysobjects表中筛选出特定类型的表或视图,并按照类型进行排序。主要关注如何根据syscolumns表中的列名来定位到对应的表或视图。
1065

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



