| 
 Posted by Susie-Q on 06/17/46 11:31 
Hugo, 
 
Thanks for replying to my post. I now understand that the sp_refreshview 
updates the meta-data for the view. I assume the meta-data is in one of 
the system tables. 
 
However, I would like to know if my script could be written differently. 
The sp_refreshviews raises a 'fatal' error when it cannot recreate a 
view. I had originally tried to capture the error code using @@error but 
as soon as the 'severe' error was encountered it kicked me out of the 
loop. I found that I could validate the view with the above select 
statement. It also fails when it encounters an error message but allows 
me to capture it and continue to loop. Do you have any suggestions or 
insight into a better way to handle the error issue? I need to loop 
through the views in each database. I never know what views are or are 
not in them. 
 
Regards, 
Susie 
 
*** Sent via Developersdex http://www.developersdex.com ***
 
  
Navigation:
[Reply to this message] 
 |