列查询的SQL查询 [英] SQL query for column name
本文介绍了列查询的SQL查询的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如果我不知道表的列名但是我知道名字的某些部分,那么如何在sql数据库中搜索列名。
问候,
Rahul Agarwal
解决方案
SELECT COLUMN_NAME,TABLE_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE COLUMN_NAME LIKE ' %name%'
使用相同的查询并将'%name%'中的名称替换为您的搜索关键字。
您可以使用INFORMATION_SCHEMA
,请参阅此处: http://en.wikipedia.org/wiki/Information_Schema [ ^ ]
如何在数据库的所有表中搜索列名以及如何搜索包含特定文本的存储过程 [ ^ ]
sql- server-query-to-find-column-from-all-tables-of-database / [ ^ ]
t-sql-find-column-name-in-database-in-any-table-using-sql-server-tsql-system-query [ ^ ]
查看链接......根据您的具体情况,您可以采取一些方法。
Hi,
IF i dont know the column name of a table but some part of the name i know, then how to search a column name in sql database.
Regards,
Rahul Agarwal解决方案SELECT COLUMN_NAME, TABLE_NAME FROM INFORMATION_SCHEMA.COLUMNS WHERE COLUMN_NAME LIKE '%name%'
use the same query and replace name in '%name%' with your searching keyword.
You can useINFORMATION_SCHEMA
, see here : http://en.wikipedia.org/wiki/Information_Schema[^]
How to search a column name within all tables of a database and how to search stored procedures containing a particular text[^]
sql-server-query-to-find-column-from-all-tables-of-database/[^]
t-sql-find-column-name-in-database-in-any-table-using-sql-server-tsql-system-query[^]
Check the links..these are some ways you can go for depending on your situation.
这篇关于列查询的SQL查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文