Validating DB Schema

  • Hi , Im trying to validate if the db schema of about 3000 fields spread in about 15 tables matches the data dictionary(in excel) and also to keep a watch on it incase someone changes a column name or adds new column, i need to be alerted an hence would like to know if there is any easy way to validate it.Thanks for all the help

  • Speedtest (5/22/2014)


    Hi , Im trying to validate if the db schema of about 3000 fields spread in about 15 tables matches the data dictionary(in excel) and also to keep a watch on it incase someone changes a column name or adds new column, i need to be alerted an hence would like to know if there is any easy way to validate it.Thanks for all the help

    Why do you have the data dictionary in Excel? You already have it defined exactly as sql server has it, right there in sql server. Trying to keep an external file up to date is going to be nearly impossible.

    You might to take a look at DDL triggers. http://msdn.microsoft.com/en-us/library/ms175941.aspx

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/

  • May be i wasnt clear in my question.....what i am trying to achieve is that when one developer makes changes to the tables, there got to be a way to check if its breaking another developers work...and hence i was thinking if we have some way to monitor the schema changes , then we can track and test such changes happening on db.....hope this helps

  • Are your table scripts under source control? Most (all?) source control systems can be set to email certain people when file changes are checked in.

    Do you have a formal development process which involves impact analysis and code review? Do you have a daily build or continuous integration process with smoke tests?

    Do you create your test database from scratch as part of your build? If so, you could run a schema check script against the previous build.

    Do you have coding standards that say 'Don't use select *'? Do you limit the use of nullable columns and force default values for new columns added?

    There are lots of ways to catch what you want.

  • Thank you so much for the reply. Apologies for still being unclear about the question raised by me , its a new job I started just few weeks back , and it looks like we are looking for automated unit tests to be carried out and its a continuos integfration with no smoke tests,Can you please guide me of what needs to be done to build some smoke tests for the datawarehouse in continuos integration ...are there any tools or any manual approach to do this.

  • Ok, we are getting somewhere now. You have a data warehouse and it is running on data extracted from an OLTP database presumably.

    Is your ETL process (extract,transform, load) process breaking because of schema changes in the OLTP database? Have you talked to the developers to make them aware that you need to know about schema changes? That's the easiest way to find out.

    Do you have this on a development setup? Are the script changes stored in source control before being rolled out? What tools are you using? What's your development process?

  • Thank you so much for your help. Sorry for the late response ......Yes all I managed to find now it that we are looking to automate unit tests in the BI more like a regression pack and still its all vague and will try to dig deep into what exactly is needed and will get back shortly...But thank you so much for your time and help.

  • TFS has a schema compare feature, not sure if you use this source control program. I fished this out with a quick Internet search on applying the schema change function. http://msdn.microsoft.com/en-us/library/aa833435(v=vs.100).aspx. (TFS is integrated into Visual Studio).

    ----------------------------------------------------

Viewing 8 posts - 1 through 7 (of 7 total)

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