Options

Permission required for using object locking

I'm trying to figure out what permissions are required for locking objects. I couldn't run the set-up script because I don't have the ability to create databases on our development server so I got a DBA to run the script. He can successful lock objects but in the Locking tab I still see the info about setting up locking. I've currently got no access to the RedGate database and before we go through a trial and error approach, thought I'd ask the question here.

Thanks, Chris
Tagged:

Comments

  • Options
    Hi Chris,

    Thanks for getting in touch. If you are trying to figure out what permissions are required these are shown below:- (These permissions are for running the actual script)

    To run the setup script, you need these database privileges:
    CREATE USER
    CREATE ROLE
    GRANT ANY PRIVILEGE
    CREATE ANY TABLE
    CREATE ANY PROCEDURE
    You don't need the privileges to lock and unlock objects.

    If the DBA is still seeing the info about setting up locking can you check that he has run the script successfully first. Please let me know if this isn't successful.

    Thanks
    Development Lead
    Redgate Software
  • Options
    chris_godfreechris_godfree Posts: 50 Silver 1
    Hi Ben, the DBA has successfully executed the script and can lock/unlock objects. It is me who still sees the message about setting up locking. We're assuming that I need some additional permissions to use locking? I'm in the db_owner role on the database we're developing but have no access to the RedGate database. Chris
  • Options
    Hi Chris,

    You'll need to make sure you have EXEC permission for the following:-
    • the function SQLSourceControl.GetLockedObjects, to retrieve locked objects
    • the function SQLSourceControl.IsObjectLocked, to check if objects are locked
    • the stored procedure SQLSourceControl.LockObject, to lock objects
    • the stored procedure SQLSourceControl.UnlockObject, to unlock objects

    If you don't then ask your DBA to set this up for you and it should resolve the problem.

    Thanks
    Development Lead
    Redgate Software
  • Options
    chris_godfreechris_godfree Posts: 50 Silver 1
    Thanks Ben
Sign In or Register to comment.