title: How to use INSERT INTO OPENROWSET to export to Excel without being an admin on the target server
body: <p>I am trying to grant a user access to export data from SQL Server into an Excel file using OPENROWSET.</p>
  
  <p>The user is getting the following error:</p>
  
  <blockquote>
    <p>Cannot initialize the data source object of OLE DB provider
    "Microsoft.ACE.OLEDB.12.0" for linked server "(null)".</p>
  </blockquote>
  
  <p>We can reproduce the issue running the following block of code, which I can run successfully and the user cannot:</p>
  
  <pre><code>    INSERT INTO OPENROWSET('Microsoft.ACE.OLEDB.12.0', 'Excel 12.0 Xml; HDR=YES;IMEX=0; Database=\\servername\exportdirectory\exportfile.xlsx', 'Select ExcelColumn from [TabName$]')
      SELECT TOP 1 SQLColumn FROM SQLTable
  </code></pre>
  
  <p>The only difference I can see between the users is that those who can successfully run this command and get the data into Excel are admins on the Windows server hosting both the SQL instance and the target directory.  </p>
  
  <p>The user who is unable to run the code has full control permissions on the target file directory where the excel file resides and has sysadmin permissions on the SQL instance.</p>
  
  <p>Is there any way to allow this user to write to this file without granting full server admin rights on the Windows server itself?</p>