SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

Rebuild or recompile all views

By Doug Deneau,

This is a simple little script, but may come in handy for some. During our database upgrades we always run a series of utility steps to make sure our code is in sync and functioning properly based on the revisions that have been made for each release. This script is one of those run to recompile all views to catch any "SELECT *" views, or views where the underlying schema has changed and we missed changing the view.

This can be added as one of your steps to your deployment SQL.

Total article views: 380 | Views in the last 30 days: 39
 
Tags
rebuild    
recompile    
refresh    
views    
 
Contribute