SQL statement to get column type

schemasql

Is there a SQL statement that can return the type of a column in a table?

Best Solution

Using SQL Server:

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