Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql get table columns list sql

sp_columns [tablename]
Comment

list all columns in a table sql

SHOW COLUMNS FROM table_name
Comment

list table columns sql

DESCRIBE table_name; /* List all columns of a database's table*/
Comment

list-table-columns- in-sql-server

select schema_name(tab.schema_id) as schema_name,
    tab.name as table_name, 
    col.column_id,
    col.name as column_name, 
    t.name as data_type,    
    col.max_length,
    col.precision
from sys.tables as tab
    inner join sys.columns as col
        on tab.object_id = col.object_id
    left join sys.types as t
    on col.user_type_id = t.user_type_id
order by schema_name,
    table_name, 
    column_id;
Comment

PREVIOUS NEXT
Code Example
Sql :: sql integer to serial 
Sql :: run sql script from command line 
Sql :: sample clause in sql 
Sql :: replace text in sql 
Sql :: subquery in sql 
Sql :: inner join 
Sql :: get sum sqlite android 
Sql :: codeigniter get sql query string 
Sql :: Syntax error or access violation: 1701 Cannot truncate a table referenced in a foreign key constraint 
Sql :: sql left 
Sql :: mysql loop 
Sql :: sql get character at index 
Sql :: mysql biginteger size 
Sql :: get largest number in database sql 
Sql :: t-sql random number for each row 
Sql :: sql find all different values in column 
Sql :: postgresql function round 
Sql :: find mysql password 
Sql :: oracle sql generate list of days 
Sql :: How to get last inserted primary key in SQL Server 
Sql :: declare or use variable in snowflake 
Sql :: oracle generate list of dates in between a date range 
Sql :: sql server version check 
Sql :: move files from one folder to another in sql server 
Sql :: SQL COUNT() with GROUP BY 
Sql :: select mysql limit to 2 decimal places 
Sql :: php delete database 
Sql :: sql vs nosql or mysql vs mongodb 
Sql :: connecting to postgresql on windows amd ubuntu 20.04 
Sql :: psql shell 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =