Search a column name across all databases

后端 未结 6 1753
佛祖请我去吃肉
佛祖请我去吃肉 2021-01-05 12:21

I have this query that finds all tables and views that matches my column name of a certain database. I am using SQL SERVER 2008

SELECT table         


        
6条回答
  •  轮回少年
    2021-01-05 12:57

    select * from information_schema.tables
    where table_name like upper('%email%'); '
    

    Explain:
    Table_name is the name of the column
    all commands that helped me find the columns 'email' > Steps taken:

    show databases ;
    show tables;
    select * from information_schema.tables;
    
    select * from information_schema.tables
    where table_name like upper('%email%');'
    

提交回复
热议问题