title: How to disable a SQL Server view?
body: <p>I have a view in SQL Server which is getting data from some remote database. But my "user" does not have permission to get that database. </p>
  
  <p>So whenever I am executing or firing select query with that view, I get some errors:</p>
  
  <blockquote>
    <p>Msg 208, Level 16, State 1, Procedure XYZ, Line 32 [Batch Start Line 0]<br>
    Invalid object name 'REMOTE_DB.dbo.Remote_Table_Name'.</p>
    
    <p>Msg 4413, Level 16, State 1, Line 6<br>
    Could not use view or function 'XYZ' because of binding errors.</p>
  </blockquote>
  
  <p>I want to know how we can enable/disable a view in SQL Server like a trigger. I'd like to be able to disable a view while I am doing any script execution over my database and will enable again. </p>
  
  <p>FYI, I can't drop or delete that view for now because of some dependencies. So I only want temporary disabling of view.</p>