All Articles on SQL - Database State

Find out when the last restore was done to a database

Posted 04 January 2010 - Category SQL Sub Category Database State

Looking at the properties of a database in sql server management studio does not show when the last restore had occurred. Running the following script in query analyser will.

Recompile all stored procedures, user-defined functions and views in the database

Posted 01 March 2011 - Category SQL Sub Category Database State

This script will recompile all stored procedures, user-defined functions and views in the database. This will refresh stored procedures execution plans stored in memory in order to reflect recent schema changes. Previous structures for instance in table functions can be held which will not represent new table structures correctly. So as a process it is good to run this when deploying new versions of the database.

Choose from the right hand menu to see full lists within subcategories