We are supporting MS SQL Server 2008 (2005 maybe), Oracle as well as Sybase. There is a large script which takes AWHILE, which would build tables, stored procedures, views, triggers, etc. as well as populate tables with what we think is sensible data.
Now we are trying to introduce unit tests to the system, to test stored procedures, mostly, as well as interactions of them. So, I do not expect running statements and stored procedures particularly challenging.
The difficult part is maintaining a proper state of the database before and after the test has run, even if any exceptions occur. Yes, I can utilize the using statement together with 'IDisposable'. The harder part for me is (at least based on what I do and do not yet know about programming): how do I safely restore the state of the MS SQL, Oracle and Syabse database thousands of times over and over? I should not make an assumption that only one user is exercising it at any point in time, although I am willing to consider it. I am hoping that all 3 databases provide mechanisms for that, and I only need to trigger them using the right driver (We tested ODBC already - it seems to work for us).
Please leave your suggestions as well as questions, if you have them.