我怎样才能得到一个数据库表中的字段名称? [英] How can I get the field names of a database table?
本文介绍了我怎样才能得到一个数据库表中的字段名称?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我怎样才能得到一个MS Access数据库表中的字段名称?
How can I get the field names of an MS Access database table?
有一个SQL查询我可以使用,或者是有C#code做到这一点?
Is there an SQL query I can use, or is there C# code to do this?
推荐答案
这将SQL Server 2005上最多工作:
this will work on sql server 2005 and up:
select * from INFORMATION_SCHEMA.COLUMNS
where TABLE_Name='YourTableName'
order by ORDINAL_POSITION
这篇关于我怎样才能得到一个数据库表中的字段名称?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文