SQL table properties reporting

This is a very simple question to which I haven't yet found an answer. I've just started working with SQL Server, and would like to print out a report listing the properties (Ie. field types, length, description, etc.) of all of my tables. How do I do this

Thanks in advance.


Answer this question

SQL table properties reporting

  • CourtJesterG

    There are probably far better ways to do this, and (disclaimer) I don't think MS would recommend querying the systems tables because they may be subject to change (which would break your code); but here it is:

    SELECT [sysobjects].name, [syscolumns].name, [systypes].[name], [syscolumns].[length]

    FROM [dbo].[systypes] inner join [syscolumns] on [syscolumns].xtype = [systypes].xtype

    inner join [sysobjects] on [sysobjects].id = [syscolumns].id


  • SQL table properties reporting