[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

JFB

3/29/2007 8:20:00 PM

Hi All,
I have an sp that execute xp_cmdshell but looks like the user need sysadmin
role to execute this.
How can I give permission to execute just this sp temporaly ? because I
don't want give sysadmin to this user.
Maybe something like:
ALTER PROCEDURE [dbo].[sample]

AS

BEGIN

-- SET NOCOUNT ON added to prevent extra result sets from

-- interfering with SELECT statements.

SET NOCOUNT ON;

-- Insert statements for procedure here

declare @temp nvarchar(4000)

set @temp = 'dir c:\'

??? set system admin permission

exec master.dbo.xp_cmdshell @temp

??? remove system admin permission

END

Tks in advance

JFB