SQL 获取列名


获得列名

 

select   name   from   syscolumns   where   id=object_id('ds_field')


或  


select col_name(object_id('table'),1) from sysobjects where name='table'  

 

--读取库中的所有表名


select name from sysobjects where xtype='u'

 

--读取指定表的所有列名


select name from syscolumns where id=(select max(id) from sysobjects where xtype='u' and name='表名')


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM