Search
 
SCRIPT & CODE EXAMPLE
 

SQL

get all tables with column name sql

SELECT      c.name  AS 'ColumnName'
            ,t.name AS 'TableName'
FROM        sys.columns c
JOIN        sys.tables  t   ON c.object_id = t.object_id
WHERE       c.name LIKE '%MyName%'
ORDER BY    TableName
            ,ColumnName;
Comment

how to get all table names in sql query

BY LOVE SINGH

SELECT TABLE_NAME
FROM INFORMATION_SCHEMA.TABLES
WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_CATALOG='YOUR_Database_name'
Comment

get a list of table names and field names from SQL

     SELECT
          TABLE_SCHEMA AS TABLE_SCHEMA
         ,TABLE_NAME AS TABLE_NAME
         ,COLUMN_NAME AS COLUMN_NAME
     FROM INFORMATION_SCHEMA.COLUMNS

    --Where COLUMN_NAME Like '%Put_Your_Comumn_Name_HERE%' 
        
     ORDER BY
          TABLE_SCHEMA
         ,TABLE_NAME
         ,COLUMN_NAME;
Comment

mssql get all table names

SELECT name from sysobjects where type = 'U'
Comment

Get all table names in SQL

SELECT name, crdate FROM SYSOBJECTS WHERE xtype = 'U';
-- or 
SELECT * FROM INFORMATION_SCHEMA.TABLES
-- or 
SELECT * FROM databaseName.INFORMATION_SCHEMA.TABLES;
Comment

get table column names sql

SELECT      COLUMN_NAME AS 'ColumnName'
FROM        INFORMATION_SCHEMA.COLUMNS 
WHERE 
TABLE_NAME LIKE '%assembly_armatureassy_tbl%' 
and COLUMN_NAME LIKE '%supplied%'
Comment

get all tables with column name sql

Get table containing given field
Comment

PREVIOUS NEXT
Code Example
Sql :: sql get number of days between two dates 
Sql :: postgres add superuser to database 
Sql :: sql select except null 
Sql :: mysql search like order by best match 
Sql :: drop table 
Sql :: update set with inner join oracle 
Sql :: copy one column data to another in sql 
Sql :: drop all database tables oracle sql developer 
Sql :: how to find the most occuring in SQL 
Sql :: postgresql list columns 
Sql :: mysql login console 
Sql :: difference between where and having clause 
Sql :: ER_NOT_SUPPORTED_AUTH_MODE: Client does not support authentication protocol requested by server; consider upgrading MySQL client 
Sql :: mysql root localhost run 
Sql :: hour and minute between two datatime sql 
Sql :: how to add foreign key constraint in sql 
Sql :: oracle grant select on schema 
Sql :: t sql check active deadlock 
Sql :: sql ends with string 
Sql :: mysql last year 
Sql :: not operator in oracle 
Sql :: mysql add fields 
Sql :: this is incompatible with sql_mode=only_full_group_by laravel 
Sql :: sql remove not null constraint 
Sql :: grant read only privileges postgres user 
Sql :: mysql get all tables row count 
Sql :: sqlite3 read only 
Sql :: SQL loop with cursor 
Sql :: mysql install with docker 
Sql :: install postgresql centos 5 
ADD CONTENT
Topic
Content
Source link
Name
6+1 =