Ensure your view and function meta data is upto date.
        Posted  
        
            by simonsabin
        on SQL Blogcasts
        
        See other posts from SQL Blogcasts
        
            or by simonsabin
        
        
        
        Published on Thu, 29 Apr 2010 14:29:05 GMT
        Indexed on 
            2010/04/29
            14:38 UTC
        
        
        Read the original article
        Hit count: 456
        
Filed under: 
        You will see if you use views and functions that SQL Server holds the rowset metadata for this in system tables. This means that if you change the underlying tables, columns and data types your views and functions can be out of sync. This is especially the case with views and functions that use select * To get the metadata to be updated you need to use sp_refreshsqlmodule. This forces the object to be “re run” into the database and the meta data updated. Thomas mentioned sp_refreshview which is a...(read more)
        
        © SQL Blogcasts or respective owner