SQL Server - testing the database

What tools are people using for testing SQL Server databases?

By this I mean all parts of the database:

  • configuration
  • tables
  • column type
  • stored procedures
  • constraints

Most likely, there is not one tool to do it all.

Answers


How do you mean "Test the database"?

If you are testing foreign keys, a simply script to insert invalid data is all you should need.

Testing a database could imply a great number of issues. Does it have all the tables? Are the tables correct? Are the indexes in place? Did the latest updates get applied? Has the data been migrated? Is the even valid? Are the foreign keys correct?

There is a lot to test in a database so you are unlikely to find a simple way to test it. I find that a combination of test stored procedures and some Nunit unit tests do most of the vetting of my databases.


I personally use NHibernate with SqlCe, this provides a "throw-away" database that doesn't need any specialized tear down after the tests are run.

It also provides a good way to test your nhibernate mappings if applicable.

Here is a link to an article I wrote awhile ago on how to accomplish this: http://www.codeproject.com/KB/database/TDD_and_SqlCE.aspx?display=Print


Need Your Help

Better way to find matches in two sorted lists than using for loops? (Java)

java list compare sorted

I have two sorted lists, both in non-decreasing order. For example, I have one sorted linked list with elements [2,3,4,5,6,7...] and the other one with elements [5,6,7,8,9...].

JSTL/JSP EL (Expression Language) in a non JSP (standalone) context

java jsp el text-formatting

Can anyone recommend a framework for templating/formatting messages in a standalone application along the lines of the JSP EL (Expression Language)?