Translate

Friday, 28 July 2017

sql query to get table definition

sp_help 'tableName'
example : sp_help 'Category'

OR

select Table i.e.
Category
and press   Alt+F1

OR

SELECT  * FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Category'

OR Customize query

SELECT COLUMN_NAME as 'Column', DATA_TYPE as 'Data Type', CHARACTER_MAXIMUM_LENGTH as 'Max Length' ,IS_NULLABLE as 'IS Null Status'
FROM INFORMATION_SCHEMA.COLUMNS WHERE TABLE_NAME = 'Category'




No comments:

Post a Comment