Many times we need to generate/document definition of database table. every objects that we define in SQL Server internally it stores into system table. below given query will help you to extract definition of table object from database. Note: further you can easily extend this query to retrieve more information from sys objects as per your requirement. SELECT o.TableName,c.name AS ColumnaName,t.name AS DataType,c.max_length, c.is_nullable FROM sys.columns c left outer join sys.types t on c.user_type_id = t.user_type_id INNER JOIN ( SELECT object_id , s.name+'.'+t.name AS TableName FROM sys.objects t INNER JOIN sys.schemas s on t.schema_id = s.schema_id WHERE type = 'U' AND s.name = '<Schema Name>' and t.name Like '%<table Name>%' )o on o.object_id = c.object_id Order By o.object_id , c.column_id