如何搜索数据库中所选表的所有列 [英] How to search all columns of selected tables in a database
本文介绍了如何搜索数据库中所选表的所有列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好
我发现这篇文章哪个是最好的,几乎解决了我的问题,
但问题发生在我尝试在我的网站内搜索时。
问题当我搜索一个名字并显示用户名和密码表时发生。
如何选择特定的搜索表?
另外我如何根据搜索获得表格列表以及唯一ID(我想用这个唯一ID来限制用户搜索到其他用户)
谢谢
Hi everyone
I found this article which was the best and almost solved my problem,
but the problem occurred when I tried the same for searching within my site.
The problem occurred when I searched for a name and it showed the username and password tables.
How can I select specific tables for the search?
Also how can I get the list of tables based on the search and also a unique id (this unique id I want to use to restrict one user search to with the other user)
Thank You
推荐答案
试试这个,
Try this,
select TABLE_NAME from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='pass_unique_columnname_here'
(或)
(or)
select * from INFORMATION_SCHEMA.COLUMNS where COLUMN_NAME='pass_unique_columnname_here'
Hi,
select * from INFORMATION_SCHEMA.COLUMNS where Table_Name=@tableName
谢谢
Dinesh Sharma
Thanks
Dinesh Sharma
这篇关于如何搜索数据库中所选表的所有列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文