How to systematically manage a Big List of Queries and Tables in SQL Server ?

  • Suppose someone has to work on a lot of different SQL Server Databases which have got a lot of Tables and Queries / Views inside them.

    After a period of time, it becomes very difficult to remember exactly what kind of columns are present within a given Table and View.

    Please suggest some method by which one can keep a systematic list of all the Tables and Views that are present within a SQL Server Database, along with the columns that are present within them.

    Are there any Add-on products or services etc. available that helps in making this type of work systematic?

    Currently I add comments to each queries inside SQL Server to remind me of what this query is doing, but this method is not great. I am looking for some better and more efficient methods.

    Please share any ideas that you might have in this direction.

    Thanks a lot

  • All Database metadata

    is stored in the INFORMATION_SCHEMA views.

    Example below.

    USE [Database Name]

    GO

    SELECT *

    FROM INFORMATION_SCHEMA.COLUMNS

  • Use the sp_addextendedproperty procedure to store a descriptive comment against each Table, Column, Index, etc? This is stored at a database level and can be part of any query about Tables / Columns etc.

    If you will in the Description in SSMS for a Table / Column etc. that is stored using sp_addextendedproperty, so comes to the same thing (if you would prefer to create/maintain it with the GUI rather than raw SQL.

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply