hi DBAs and others,
We have a developer that has used the following in a stored proc to move a file:
SET @SQL = 'move ' + @FilePath + ' ' + @ArchivePath + 'inbound_' + Convert(nvarchar(20), @FileNumber) + '.txt'
EXEC master..xp_cmdshell @SQL
The problem is that to execute this sp, you have to either login as sa OR your login must have sys admin permissions ??
I guess I have a couple of questions:
1. Is there another way to move a file, other than using xp..cmdshell?
2. If we must use xp..cmdshell, how can I enable this user to execute this sp without logging on as 'sa' ?
Thanks, John
We have a developer that has used the following in a stored proc to move a file:
SET @SQL = 'move ' + @FilePath + ' ' + @ArchivePath + 'inbound_' + Convert(nvarchar(20), @FileNumber) + '.txt'
EXEC master..xp_cmdshell @SQL
The problem is that to execute this sp, you have to either login as sa OR your login must have sys admin permissions ??
I guess I have a couple of questions:
1. Is there another way to move a file, other than using xp..cmdshell?
2. If we must use xp..cmdshell, how can I enable this user to execute this sp without logging on as 'sa' ?
Thanks, John