Results 1 to 4 of 4
  1. #1
    Join Date
    Dec 2003
    Posts
    51

    Unanswered: Problems in grant permission

    Hi All,
    In one of my sybase database, I have to grant select,insert,update,delete permissions on a user to some tables.

    Want a set of grant commands like as follows ?

    GRANT SELECT, INSERT, UPDATE, DELETE ON table1 TO username
    GRANT SELECT, INSERT, UPDATE, DELETE ON table2 TO username
    GRANT SELECT, INSERT, UPDATE, DELETE ON table3 TO username

    OR - Is there any single command to give these permissions to all tables ?

    thanks

  2. #2
    Join Date
    Dec 2003
    Posts
    23
    If need to grant to all tables, the best way to do it is to run:

    select "grant SELECT, INSERT, UPDATE, DELETE ON " + name + ' to USERNAME' from sysobjects where
    type='U'
    go

    then run the output.

    I would suggest creating a role and granting the permissions to it. That way you can add users to the role. So:

    select "grant SELECT, INSERT, UPDATE, DELETE ON " + name + ' to ROLENAME' from sysobjects where
    type='U'
    go

    then run the output

  3. #3
    Join Date
    Dec 2003
    Posts
    51
    hi 23skeedoo,

    thanks a lot for the valuable information . I was searching this in sybase.

    thanks
    Pinto

  4. #4
    Join Date
    Mar 2006
    Posts
    25

    Unhappy

    simply use
    grant all on tablename to username


    Quote Originally Posted by Pinto
    Hi All,
    In one of my sybase database, I have to grant select,insert,update,delete permissions on a user to some tables.

    Want a set of grant commands like as follows ?

    GRANT SELECT, INSERT, UPDATE, DELETE ON table1 TO username
    GRANT SELECT, INSERT, UPDATE, DELETE ON table2 TO username
    GRANT SELECT, INSERT, UPDATE, DELETE ON table3 TO username

    OR - Is there any single command to give these permissions to all tables ?

    thanks

Posting Permissions

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