Documention

  • trying to come up with a few commands that I can use to query my SQL Server 2000 Instances and Document my Databases - preferably Excel

    exec sp_helpdb comes to mind.. can anyone help me further?

  • This script is pretty good.

    http://www.sqlservercentral.com/scripts/Miscellaneous/31574/

  • Thanks but I got some crazy HTML output that really isn't very usefull to me..

  • Jpotucek (11/28/2007)


    trying to come up with a few commands that I can use to query my SQL Server 2000 Instances and Document my Databases - preferably Excel

    exec sp_helpdb comes to mind.. can anyone help me further?

    Does sp_HelpDB give you all of the information you want?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Yes, I have been using sp_helpdb databasename. this gives me DB name, logical DB name, physical file locations, size, owner.....

    From there I am able to cut and paste what I need into excel but it's tedious...

  • Trying to figure out what you need and this seems simple to you because you know what you want... but we don't...

    You say the copy/paste into Excel is tedious... what is it about it that's tedious? Do you need to split the Status column or are you trying to paste the output exactly like it is or what?

    Are you using the grid mode for the copy paste or the text mode?

    Please help us help you... be a bit more descriptive as to what you'd like to get from sp_HelpDB into Excel.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • J,

    I use this to keep track of the Version and Edition on all of our SQL Server systems.

    Written for use in both SQL Server 2000 and SQL Server 2005!

    Happy Coding!

    -- Show information about all SQL Server Databases in a given instance.

    -- SQL Server 2000

    USE master

    GO

    select

    -- getdate() as 'Time_Data_Gathered'

    --,

    cast(serverproperty('ServerName') as varchar(20)) as [Server Name]

    ,Case when serverproperty('InstanceName') is null

    then '(default)'

    else serverproperty('InstanceName')

    end as [Instance Name]

    ,name as [Database Name]

    ,cast(serverproperty('productversion') as varchar(20)) as [Product Version]

    ,cast(serverproperty('productlevel') as varchar(20)) as [Product Level]

    ,cast(serverproperty('edition') as varchar(40)) as [Edition]

    FROM dbo.sysdatabases

    -- SQL Server 2005

    USE master

    GO

    select

    -- getdate() as 'Time_Data_Gathered'

    --,

    cast(serverproperty('ServerName') as varchar(20)) as [Server Name]

    ,Case when serverproperty('InstanceName') is null

    then '(default)'

    else serverproperty('InstanceName')

    end as [Instance Name]

    ,name as [Database Name]

    ,cast(serverproperty('productversion') as varchar(20)) as [Product Version]

    ,cast(serverproperty('productlevel') as varchar(20)) as [Product Level]

    ,cast(serverproperty('edition') as varchar(40)) as [Edition]

    FROM sys.databases

    "Key"
    MCITP: DBA, MCSE, MCTS: SQL 2005, OCP

  • Jpotucek,

    C'mon... I'm trying to help... I need the answers to the questions I asked above so we can avoid the problems you're having...

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Documenting is hard, often because there's no good place to keep documentation handy. I prefer ER diagrams, but you really need some snippets from Word or someplace handy to note what columns mean. And it should be something that links together related columns.

    I've tried Word, Excel, Visio, ER/Studio, ErWin, HTML and more over the years. The only thing that's ever worked well for documenting the database is my brain loaded with experience in working with the tables.

  • J,

    Can you provide us the column list of the spreadsheet system you currently are using?

    In my environment, I use a mix of built-in procedures like sp_helpdb and the custom script (as well as others) that I posted above to populate 2 Excel spreadsheets. One tracks at the server/instance level, and the second one at the database level.

    Each document gets a review at least once a month, or when a new database server is being brought online, when a new SQL patch is released. etc.

    These spreadsheets come in real handy when my boss gives asks me to get him numbers for his next meeting (oh yeah, it is in 5 minutes) and wants a count of how many SQL 2000 instances we have on Windows 2003 or how many SQL Server 2005 databases we have currently running on SQL Server Service Pack 2.

    I would be interested in comparing the information I track with you as well as others.

    "Key"
    MCITP: DBA, MCSE, MCTS: SQL 2005, OCP

Viewing 10 posts - 1 through 9 (of 9 total)

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