Thursday, September 15, 2011

how to get the column names and corresponding datatypes in particular table using SQL Server?

SELECT column_name 'Column Name',data_type 'Data Type',character_maximum_length 'Maximum Length' FROM INFORMATION_SCHEMA.COLUMNS WHERE table_name ='Country'

For ex.:select column_name 'Column Name',data_type 'Data Type',character_maximum_length 'Maximum Length' from INFORMATION_SCHEMA.COLUMNS where table_name='CreativeWork'

0 comments:

Post a Comment