Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
6 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
2 answers
asked May 5, 2020 in SQL by Sudhir_1997 (55.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...