Tuesday, March 20, 2012

Required permissions for running TextCopy?

I posted this last week, but unfortunately it was lost. So here 'tis again.

I am having trouble with working out what permissions a user needs to run the Textcopy function.

I have setup a stored procedure on the server which runs Textcopy to insert/export a GIF file to/from a network location to an Image field of a database. The stored procedure is called from an Access97 frontend.

It all works fine when the user on the client PC has SQL Server System Administrator permissions, however when the client PC is logged in as a normal user without these permission, the operation fails. Giving the user System Admin permissions fixes the problem, but obviously I can't do this for all the users!

Does anyone have any idea exactly what individual items I need to set permissions for to enable Textcopy to run??

Any hints at all, (no matter how small) would be much appreciated.

Thanks,

Ian.
:confused:What messages appear in the event viewer ? What are the current permissions on the textcopy.exe file ?|||Thanks for those thoughts.

Permissions on the file and directory are set to Full Control Everyone. (can't be that)

I can't find any messages being writen to the event log when this error occurs.

Ian.|||Please provide the stored procedure code.|||Here is SQL stored procedure:

CREATE PROCEDURE sp_textcopy (
@.srvname varchar (30),
@.login varchar (30),
@.password varchar (30),
@.dbname varchar (30),
@.tbname varchar (30),
@.colname varchar (30),
@.filename varchar (60),
@.whereclause varchar (50),
@.direction char(1))
AS
DECLARE @.exec_str varchar (255)
SELECT @.exec_str =
'D:\Temp\textcopy /S ' +@.srvname +
' /U ' + @.login +
' /P ' + @.password+
' /D ' + @.dbname+
' /T ' + @.tbname +
' /C ' + @.colname +
' /W "' + @.whereclause+
'" /F ' +@.filename+
' /' + @.direction+
' /Z'
EXEC master..xp_cmdshell @.exec_str
GO|||What are the permissions on xp_cmdshell ?|||The permission on xp_cmdshell (in the master DB) are set to enable the cleint user run it.

(They weren't before but they are now. Still won't work)|||Did you create a sql server agent proxy account ?|||Do you mean a Proxy Server account for the same account that SQL Server agent runs under?

How does this effect it?

I would have thought that the permissions are within SQL as setting the account to be a SQL administrator fixes the problem? (I could be wrong)|||SQL server uses this account to execute the xp_cmdshell - it also uses this account for execution of an agent job (both of these apply to non-sysadmin accounts). For non-sysadmin accounts, these commands will be executed under the security context of this account. So you have to create a sql server agent proxy account.|||You were Right!!

I had not created a SQL Server Agent Proxy Account.

When I eventually found this and created an account it works.

Thanks a lot!

Ian.|||Originally posted by rnealejr
SQL server uses this account to execute the xp_cmdshell - it also uses this account for execution of an agent job (both of these apply to non-sysadmin accounts). For non-sysadmin accounts, these commands will be executed under the security context of this account. So you have to create a sql server agent proxy account.

how do you create a sql server agent proxy account?

No comments:

Post a Comment