sql语句查询表的字段名

来源:互联网 发布:淘宝旺铺智能版免费 编辑:程序博客网 时间:2024/04/30 05:55

select name from syscolumns where id in (select id from sysobjects where type = 'u' and name = '相应表名')  
用以上sql语句输入相应表名就可以查到表的字段名,对应好数据库 查询是否存在该表语句  

 

select name from syscolumns where id=object_id('表名')