sp_refreshview throwing an error
-
Friday, December 14, 2012 4:31 AMModerator
It can't be permission since I am the dbo. I just recompiled the view.
USE AdventureWorks2012; GO EXEC sp_refreshview 'Sales.vSalesByDateByProduct'; /* Msg 15165, Level 16, State 1, Procedure sp_refreshsqlmodule_internal, Line 55 Could not find object 'Sales.vSalesByDateByProduct' or you do not have permission. */ SELECT object_id('Sales.vSalesByDateByProduct','V'); -- 140579589
Kalman Toth SQL 2008 GRAND SLAM
New Book: SQL Programming & Database Design Using Microsoft SQL Server 2012- Edited by Kalman TothMicrosoft Community Contributor, Moderator Friday, December 14, 2012 4:47 AM
All Replies
-
Friday, December 14, 2012 4:39 AMModeratorDo you get the same error when you do this using dynamic SQL?
For every expert, there is an equal and opposite expert. - Becker's Law
My blog -
Friday, December 14, 2012 4:46 AMModerator
Same error with dynamic execution:
EXEC ('EXEC sp_refreshview ''Sales.vSalesByDateByProduct'';');
Kalman Toth SQL 2008 GRAND SLAM
New Book: SQL Programming & Database Design Using Microsoft SQL Server 2012 -
Friday, December 14, 2012 4:54 AM
Please refer the below connect:
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.
- Marked As Answer by Kalman TothMicrosoft Community Contributor, Moderator Friday, December 14, 2012 5:26 AM

