Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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.4k 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.5k points)

Browse Categories

...