Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default SQL: xp_cmdshell

    anyone use this procedure? I'm calling it from another stored procedure, but
    am getting permission issues. I don't have permission to execute it.

    Here's my SP:

    CREATE PROCEDURE updateDB AS
    Exec master..xp_cmdshell
    'DTSRUN my paramaters...'

    I'm guessing I need to set up a user with permission to access the
    xp_cmdshell? Once I do that, how do I call it as that user? Can I do that
    from my SP?

    -Darrel


    darrel Guest

  2. Similar Questions and Discussions

    1. xp_cmdshell driving me nuts! Experts please help!
      Hi, I've been struggling with this for days now with limited sucess. Manybe you guys can help out. All this would be effortless in Oracle/Unix...
    2. How stop a xp_cmdshell process ???
      Hello, Someone knows the way to stop a process genetared by command : EXEC master..xp_cmdshell @PsCMD For example: I have this code to...
    3. BCP query out executed by xp_cmdshell works fine from query analyzer but fails from VB Component
      Hi all, I have a stored procedure which returns a vast number of record and i have to write the output into a csv file. I'm using BCP utility to...
    4. Calling master..xp_cmdshell 'textcopy'
      I am attempting to create a VB call to a stored procedure that uses xp_cmdshell and textcopy to store word documents in a table. I have used an...
    5. xp_cmdshell doesn't run with the logged in user account...
      xp_cmdshell always runs under the sqlserver service account. for the copy to work, your service account must be a domain account given permission to...
  3. #2

    Default Re: xp_cmdshell

    You'd probably need to be a system administrator to do this kinda stuff.

    --
    Jules
    [url]http://www.charon.co.uk/charoncart[/url]
    Charon Cart 3
    Shopping Cart Extension for Dreamweaver MX/MX 2004


    Julian Roberts Guest

  4. #3

    Default Re: xp_cmdshell

    Hmmm... Anything that runs out of the Master table requires pretty elevated
    privileges. You'd almost have to execute this as SA, or with a user that
    has admin privileges.

    Best regards,
    Chris


    Chris In Madison Guest

  5. #4

    Default Re: xp_cmdshell

    > I'm guessing I need to set up a user with permission to access the
    > xp_cmdshell? Once I do that, how do I call it as that user? Can I do that
    > from my SP?
    Whichever user calls the SP has to have permission to execute the
    xp_cmdshell stored procedure. If you have admin rights in Master database,
    you can add permission:

    GRANT execute ON master.dbo.xp_cmdshell TO yourusername

    However, the xp_cmdshell stored procedure is quite dangerous.

    --
    -------------------------------------------
    Tom Muck
    co-author Dreamweaver MX 2004: The Complete Reference
    [url]http://www.tom-muck.com/[/url]

    Extending Knowledge, Daily
    [url]http://www.CommunityMX.com/[/url]


    Tom Muck Guest

  6. #5

    Default Re: xp_cmdshell

    > You'd probably need to be a system administrator to do this kinda stuff.

    Right...but I'm not sure what I need to do.

    -Darrel


    darrel Guest

  7. #6

    Default Re: xp_cmdshell

    > Hmmm... Anything that runs out of the Master table requires pretty
    elevated
    > privileges. You'd almost have to execute this as SA, or with a user that
    > has admin privileges.
    Right...I guess that's the question. So, we need to make a new user with
    admin privliges that is allowed to execute the XP. How do I then call that
    XP as that user?

    -Darrel


    darrel Guest

  8. #7

    Default Re: xp_cmdshell

    > Whichever user calls the SP has to have permission to execute the
    > xp_cmdshell stored procedure. If you have admin rights in Master database,
    > you can add permission:
    Ah! OK, so that makes sense. I need to call my SP as the same user that has
    permission to run the XP.
    > However, the xp_cmdshell stored procedure is quite dangerous.
    How dangerous? What I am doing is this:

    We have a staging server and a public server. One database is updated
    nightly via a DTS, but there have been requests to update it manually at
    times.

    I want to put a button on an ASPX page on our intranet, that, when clicked,
    will call my SP which, in turn, calls the XP to execute the DTSRUN command
    to manually run the DTS.

    Would that cause problems?

    -Darrel


    darrel Guest

  9. #8

    Default Re: xp_cmdshell

    > I want to put a button on an ASPX page on our intranet, that, when
    clicked,
    > will call my SP which, in turn, calls the XP to execute the DTSRUN command
    > to manually run the DTS.
    >
    > Would that cause problems?
    Theoretically, yes, but practically, no. If this is being executed by a user
    that you have set up for your web application, anything that the user has
    access to is open to a hacker. If you use a different SQL user for your
    admin pages, you are making the web application a little more secure. Having
    said that, I use it myself for executing DTS from my admin pages.

    Tom


    Tom Muck Guest

  10. #9

    Default Re: xp_cmdshell

    > Theoretically, yes, but practically, no. If this is being executed by a
    user
    > that you have set up for your web application, anything that the user has
    > access to is open to a hacker.
    Oh. Gotcha. Well, this is all on our internal network, so I'm not going to
    be too worried about it.

    Good to know though!

    -Darrel


    darrel Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139