title: What is wrong with my SQL command?
body: <p>I am trying to put the query result into a PowerPoint file like the below</p>
  
  <pre><code>EXEC XP_CMDSHELL 'SQLCMD -Q "Select * From test_tbl" -O "E:test_tbl.ppt"'
  </code></pre>
  
  <p>but it is not working.</p>
  
  <p>Below is the summary that I am getting</p>
  
  <pre><code>**output**
  
  Sqlcmd: Warning: '-O' is an obsolete option and is ignored.
  Msg 208, Level 16, State 1, Server SUMERU-49484E24, Line 1
  Invalid object name 'TableName'.
  NULL
  </code></pre>
  
  <p>Before executing this query I have already enabled the xp_cmdshell by using sp_configure.</p>
  
  <p>Also I have the .ppt file in the proper location.</p>
  
  <p>I have doing this just for my own sake of experiment.</p>
  
  <p>Kindly help me in executing the same.</p>
  
  <p>Using SQL Server 2005.</p>
  
  <p>Edit:</p>
  
  <p>I have changed the query like the below </p>
  
  <pre><code>EXEC XP_CMDSHELL 'SQLCMD -Q "Select * From test_tbl" -s "SUMERU-49484E24\SQLEXPRESS2008" -d "test" -E -o "D:t2.ppt"'
  </code></pre>
  
  <p>But the below is the error in the pptfile</p>
  
  <pre><code>HResult 0xFDC, Level 11, State 1
  Cannot open database requested in login 'test'. Login fails.
  HResult 0x4818, Level 14, State 1
  Login failed for user 'NT AUTHORITY\SYSTEM'.
  HResult 0x4, Level 16, State 1
  Shared Memory Provider: I/O Error detected in read/write operation [4]. 
  Sqlcmd: Error: Microsoft SQL Native Client : Communication link failure.
  </code></pre>
  
  <p>Thanks</p>