title: Export from SQL Server to Excel and Email as Attachment through SQL Agent
body: <p>I realize that this question spans many technologies, but I am only looking for high-level contributions here.</p>
  
  <p>I am currently tasked with exporting from a SQL Server proc into Excel, and then email the Excel file as attachment through SQL Agent. The SQL Agent job must be run daily.</p>
  
  <p>What I have tried:</p>
  
  <ul>
  <li>
  SQL -> Excel using xp_cmdshell & bcp. This is fine but then the excel output changes non-alpha text fields to numbers. (ie. phone numbers)
  </li>
  <li>
  SQL OpenRowset. I can't overcome the lack of the Jet 4.0 provider to use OpenRowset due to 64bit Win7 -- from what I understand.
  </li>
  <li>
  SSIS. After overcoming the dynamic file name predicament, I get stuck when my data types in from SQL to Excel didn't match up. (some Unicode to non Unicode issue)
  </li>
  <li>
  I can write the export process in .NET but then I do not know how to attach it to SQL Agent.
  </li>
  </ul>
  
  <p>I guess my biggest question is, if you were going to address this yourself (as I am sure many of you must) which technology path should I take? </p>
  
  <p>NOTE: I am almost certain I should not install Office on the Server</p>
  
  <p>Thanks in advance.</p>