Search
 
SCRIPT & CODE EXAMPLE
 

SQL

sql query to get column names and data types in sql server

SELECT COLUMN_NAME, 
	DATA_TYPE, 
    IS_NULLABLE, 
    CHARACTER_MAXIMUM_LENGTH, 
    NUMERIC_PRECISION, 
    NUMERIC_SCALE 
FROM 'your_database_name'.INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME='your_table_name';
Comment

get column types SQL SERVER

SELECT DATA_TYPE 
FROM INFORMATION_SCHEMA.COLUMNS
WHERE 
     TABLE_SCHEMA = 'yourSchemaName' AND
     TABLE_NAME   = 'yourTableName' AND 
     COLUMN_NAME  = 'yourColumnName'
Comment

PREVIOUS NEXT
Code Example
Sql :: show list of users in mysql 
Sql :: postgres add not null to existing column 
Sql :: how to install psql in ubuntu 
Sql :: get the next auto_increment value mysql 
Sql :: psql connections 
Sql :: mysql add column if not exists 
Sql :: mysql get longest string in column 
Sql :: oracle select first 10 rows 
Sql :: sql server list table sizes 
Sql :: convert_tz mysql 
Sql :: oracle add column 
Sql :: mysql command line connect 
Sql :: update with inner join 
Sql :: oracle service name view 
Sql :: how to check when a stored procedure was last modified in sql server 
Sql :: how to remove unique key constraint in mysql 
Sql :: postgresql convert text to float 
Sql :: postgres read table structure 
Sql :: how to create index mysql 
Sql :: postgresql alter column nullable 
Sql :: oracle drop chain step 
Sql :: mysql left join exists 
Sql :: sql change table name 
Sql :: postgresql pg_dump 
Sql :: postgres update column with value from another table 
Sql :: query any digits record 
Sql :: pentaho + pasar de excel a sql 
Sql :: list all tables and columns in postgresql 
Sql :: mysql insert generate serie 
Sql :: SELECT LOCKED FROM public.databasechangeloglock WHERE ID=1 
ADD CONTENT
Topic
Content
Source link
Name
3+4 =