Analyzing a database

  • I was put in charge of an old sql 2005 database that no one knows much about. I can't even find anyone that knows the app well that the database supports!

    I've reversed engineered the database (SSMS diagrammer-- yecch), am studying the tables names, relationships, and looking at the data in the tables, trying to figure out what is going on.

    If you had the same task, how would you proceed to understand\analyze this database? (Helpful tool suggestions always appreciated.)

    TIA,

    Barkingdog

  • Running the Data Profiling Task in SSIS against a table in the db can be quite helpful.

  • I find the following script to be very helpful when making changes to a database I am unfamiliar with. Let's say you have a table or procedure that needs to be changed and you don't know what other consequences could happen as a result (a report procedure, import process, etc could be also be affected). This will search through all of the text data in the database objects (procedures, triggers) to find the string you specify.

    SELECT so.Name

    FROM sysobjects so

    JOIN syscomments sc

    ON sc.id = so.id

    WHERE sc.text like '%%'

    If you are making a change to a table called inventory_area, you could do a system check to see what other procedures are using it.

    SELECT so.Name

    FROM sysobjects so

    JOIN syscomments sc

    ON sc.id = so.id

    WHERE sc.text like '%inventory_area%'

    Hope that helps some!

    Jason

    Webmaster at SQL Optimizations School

  • Good ideas from everyone. Thanks.

    Barkingdog

  • I can't even find anyone that knows the app well that the database supports!

    I'd back it up, take it offline, and see who calls for it before I spent too much time on it.

    --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)
    Intro to Tally Tables and Functions

Viewing 6 posts - 1 through 5 (of 5 total)

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