You can actually do this, not directly from the SQL protocol, but the language in which you are running your application.
Due to the fact that SQL must be encapsulated in DAL (data access level) and all data obtained using repositories (or other data access classes). You can do a unit test of these classes, which will run SQL scripts at the end. So basically you check your SQL code.
Itβs easier for me than trying to write such tests in SQL. :)
I used to think about this: http://www.beletsky.net/2010/11/testing-database-and-test-database.html
Alexander Beletsky
source share