We have a problem with our table schema falling out of sync with our view schema. I would like to know how I could have a stored procedure (for Sql Server) that gets all views in the database, and executes each one via select *
Here is what I imagined (pseudo):
Declare x
Set x = Select object from sysobjects where object = view
foreach view in x
sp_execute 'select * from view'
We could then have an automated test that calls this every night. A SqlException would indicated that something was out of sync.