Back

Explore Courses Blog Tutorials Interview Questions
0 votes
4 views
in SQL by (20.3k points)

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

1 Answer

0 votes
by (40.7k points)

 For SQL Server, try using this code:

SELECT DATA_TYPE 

FROM INFORMATION_SCHEMA.COLUMNS

WHERE 

TABLE_NAME = 'yourTableName' AND 

COLUMN_NAME = 'yourColumnName'

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
1 answer
asked May 5, 2020 in SQL by Sudhir_1997 (55.6k points)

Browse Categories

...