Given the column name, how can I find which tables in the database contain this column?
or alternatively
How can I find this particular column exists for all tables in the database?
Note: Please explain the answers with examples, as I get most of the knowledge from the answer.
Edit: I am using a MySQL database.
SELECT * FROM information_schema.columns WHERE COLUMN_NAME = 'mycolumn'
. , . , SYSTEMABLE SYSCOLUMN Sybase ASA.
in SQL Server:
select distinct t.name from sys.Columns c inner join sys.tables t on c.object_id = t.object_id where c.name = 'YOUR_COLUMNNAME'
Source: https://habr.com/ru/post/1727618/More articles:How to send mail through mailx & subprcoess? - pythonCan we execute a script file with a database using free Nhibernate? - fluent-nhibernateHow to create events from graphics generated by Java2D - javaVisual Studio VB Virtualization Settings - editorjavascript XSL в Google Chrome - javascriptgoogle gears discontinued, html 5 in draft - html5.NET MVC: how to implement a different page appearance for each user? - cssA multidimensional filter to eliminate “bad” items from a large table? - arraysJavaScript's Date.getHours () looks broken for me - javascriptHow to display the site name on the sharepoint home page - sharepointAll Articles