从SQL数据库中的SQL表获取表标题 [英] Getting Table headings from SQL Tables in SQL Database
本文介绍了从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.
这篇关于从SQL数据库中的SQL表获取表标题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文