Results 1 to 12 of 12
  1. #1
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    7

    Question Unanswered: 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.

  2. #2
    Join Date
    Feb 2002
    Posts
    2,232
    What messages appear in the event viewer ? What are the current permissions on the textcopy.exe file ?

  3. #3
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    7

    Textcopy Permissions Reply

    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.

  4. #4
    Join Date
    Feb 2002
    Posts
    2,232
    Please provide the stored procedure code.

  5. #5
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    7
    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

  6. #6
    Join Date
    Feb 2002
    Posts
    2,232
    What are the permissions on xp_cmdshell ?

  7. #7
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    7
    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)

  8. #8
    Join Date
    Feb 2002
    Posts
    2,232
    Did you create a sql server agent proxy account ?

  9. #9
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    7
    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)

  10. #10
    Join Date
    Feb 2002
    Posts
    2,232
    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.

  11. #11
    Join Date
    Aug 2002
    Location
    Melbourne, Australia
    Posts
    7
    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.

  12. #12
    Join Date
    Mar 2003
    Posts
    3

    Post

    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?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •