Home All Groups Group Topic Archive Search About
Author
4 Nov 2005 10:12 PM
oldboyfriend
I have the following stored procedure, and it works for me (the
developer), but it won't work for my users.  I have set up a SQL Server
Agent Proxy user and that does not work.  Does each individual user
have to have rights on the machine to read/execute the .net console
application?

CREATE PROCEDURE [dbo].[ssp_DownloadProcessing]
    (
    @ItemNumber    varchar(255)
    , @StartDate DateTime
    )
AS
    Declare @CmdLine Varchar(500)

    select @CmdLine =  'C:\ConDL\bin\Debug\dl.exe UpdateItem' +
@ItemNumber
    PRINT 'Running: ' + @CmdLine
    EXEC master..xp_cmdshell  @CmdLine, NO_OUTPUT   
    return 0

GO

Thanks!

Author
4 Nov 2005 11:04 PM
Erland Sommarskog
(oldboyfri***@gmail.com) writes:
> I have the following stored procedure, and it works for me (the
> developer), but it won't work for my users.  I have set up a SQL Server
> Agent Proxy user and that does not work.  Does each individual user
> have to have rights on the machine to read/execute the .net console
> application?

What exactly does "does not work" mean? What error message do you get?
If you remove NO_OUTPUT, does that tell you any interesting?




--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techinfo/productdoc/2000/books.asp
Author
7 Nov 2005 3:36 PM
oldbf
All it does is return the command line  [Microsoft][ODBC SQL Server
Driver][SQL Server]Running: 'C:\ConDL\bin\Debug\dl.exe UpdateItem
Widget1'
Author
7 Nov 2005 3:37 PM
oldbf
Isn't it supposed to use the proxy account?  Or does it do that if
xp_cmdshell is executed from a stored procedure?
Author
7 Nov 2005 9:37 PM
oldbf
OK.  I think I got this.  Even though you have a proxy account set up,
that is not enough.  You must also grant a user access to the master
database and also give them rights execute the xp_cmdshell extended
stored procedure.

The BOL does not explain that even though you have a proxy account set
up, that it does not work if you use the EXEC xp_cmdshell ... from
within a stored procedure.

AddThis Social Bookmark Button