title: SQL Server Management Studio: select permission for a view 'access to path is denied'
body: <p>I have a problem with permissions on a database in SQL Server 2014.</p>
  
  <p>Group G has select permission on schema S1, which contains a lot of views.
  When I connect as a user I can see all the views but when selecting 'top 1000 rows' I get the error 'access to path is denied'. </p>
  
  <p>Schema S1 uses tables from S2 and I have also added select permissions to that schema.</p>
  
  <p>I have tried removing all access and give the Group G select permission on a table, then I also receive the same message.</p>
  
  <p>I also noticed that even though I did not grant 'view definition' rights, I can see what columns it has etc..</p>
  
  <p>I also tried giving all possible grants and 'with grant' but was unsuccessful so far.</p>
  
  <p>This is the error description when doing select on the table.</p>
  
  <p>Anyone encountered this before or has anyone any idea what I'm doing wrong?</p>
  
  <blockquote>
    <p>Access to the path is denied. (mscorlib)</p>
    
    <p>Program Location:</p>
    
    <p>at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
        at System.IO.__Error.WinIOError()
        at System.IO.Path.InternalGetTempFileName(Boolean checkHost)
        at       Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.LaunchFormHost.CreateScriptWindow(String text, String scriptType, String dbName)
        at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.LaunchFormHost.Microsoft.SqlServer.Management.SqlMgmt.ILaunchFormHost3.ScriptToNewWindowAndExecute(String text, String scriptType)
        at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.OpenTableHelperClass.SelectTopNRows(NodeContext parentContext, Int32 topNValue)
        at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.SelectTopNRows.Invoke()
        at Microsoft.SqlServer.Management.UI.VSIntegration.ObjectExplorer.ToolsMenuItemBase.MenuInvokedHandler(Object sender, EventArgs args)</p>
  </blockquote>