从SQL数据库中的SQL表获取表标题

问题描述:

大家好,

在我的应用程序中,我需要从SQL Databse表中提取表标题.
并将其放入ASP.NET的数据表中.

所以我尝试了以下查询:

Hello All,

In my application i need to extract the table headings from SQL Databse Table.
And get that in to the datatable in ASP.NET.

So i tried following Queries:

select column_name,* from information_schema.columns
 where table_name = 'YourTableName'
order by ordinal_position



但是查询成功编译,但是列中没有值.
输出表为空.

我也用过



But the query get compile successfully,But there is no values in column.
The output table is empty.

I had also used

SELECT table_name, column_name 
FROM USER_TAB_COLUMNS
 WHERE table_name =YourTableName



有人可以告诉我如何准确得到我想要的东西吗?



Can anybody tell me how do exactly get what I want???

第一个对我来说效果很好:检查您的"YourTableName"是否正确您的数据库.
The first one works fine for me: check that your ''YourTableName'' is correct for your database.