Search
 
SCRIPT & CODE EXAMPLE
 

SQL

get column name sql server

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'
Comment

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

get table column names sql ssms

SELECT COLUMN_NAME
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = 'Your Table Name'
ORDER BY COLUMN_NAME

-- IS_NULLABLE returns yes or no depending on null or not null
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

sql select column names

/* How to select the column names in SQL*/

SELECT Column_name
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'your_table_name'
/* Just change the "your_table_name" ↑ to the name of your table */
Comment

How to View column names of a table in SQL

DESCRIBE Table_Name;

OR 

DESC Table_Name;
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

sql get table columns list sql

sp_columns [tablename]
Comment

show column names in sql table

-- sql server 
sp_columns feeAgreement
-- or
SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = N'feeAgreement'
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 column name list sql

EXEC sp_columns 'Your Table Name'
Comment

get all tables with column name sql

Get table containing given field
Comment

PREVIOUS NEXT
Code Example
Sql :: mysql find duplicate rows multiple columns 
Sql :: postgres how to add field created at 
Sql :: sql server port 
Sql :: sql add column with default value 
Sql :: sql String comparisons case sensitive 
Sql :: mysql find_in_set join 
Sql :: sql drop table 
Sql :: oracle enable chain 
Sql :: how to install mysql 8.0 windows service 
Sql :: oracle create tablespace autoextend 
Sql :: postgresql concat string with separator 
Sql :: How to find string in substring in sql server 
Sql :: ms sql print more than 1 variable 
Sql :: postgresql backup and restore globals and data 
Sql :: create a PostgreSQL user django on mac 
Sql :: mysql function to remove multiple spaces from the string 
Sql :: mysql limit order by 
Sql :: show tablespace oracle 
Sql :: difference between outer join and inner join sql 
Sql :: json not contains mysql 
Sql :: finish transaction sql 
Sql :: what is relational database 
Sql :: sql like case sensitive 
Sql :: mysql on kubernetes 
Sql :: arithmetic operators in sql 
Sql :: mysql like 
Sql :: how to start with sql 
Sql :: having clause in sql 
Sql :: dump sql file to database postgres 
Sql :: how to check last index rebuild sql server 
ADD CONTENT
Topic
Content
Source link
Name
1+8 =