Home All Groups Group Topic Archive Search About

Console application to generate Excel file

Author
15 Jan 2007 1:33 PM
Senthil
Hi all
         I created a C# console application that is called through a
stored procedure using xp_cmdshell. The application generates an Excel
report from the database with a macro embedded in it. The report
generation fails when it is through xp_cmdshell.
But when I tried to run the executable from the command prompt the
report gets generated successfully with the macro. What could be the
problem here??

Thanks in advance
Senthil

Author
15 Jan 2007 7:01 PM
Rad [Visual C# MVP]
On 15 Jan 2007 05:33:02 -0800, Senthil wrote:

> Hi all
>          I created a C# console application that is called through a
> stored procedure using xp_cmdshell. The application generates an Excel
> report from the database with a macro embedded in it. The report
> generation fails when it is through xp_cmdshell.
> But when I tried to run the executable from the command prompt the
> report gets generated successfully with the macro. What could be the
> problem here??
>
> Thanks in advance
> Senthil

Probably the sql server account that you use to run the xp_cmdshell account
does not have the rights to run such system stored procedures. You'll need
to grant the account the appropriate rights