Creating roles

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • php newbie

    Creating roles

    Hello,

    I know there is sp_addrole and sp_droprole to create roles. I just
    found out that I could not use these two statements in an application
    because the application is interacting with the database within
    transactions through ODBC (SQLServer complains that these two stored
    procedures cannot be executed within transactions).

    Is there an alternative way of creating and dropping roles in plain
    SQL?
  • John Bell

    #2
    Re: Creating roles

    Hi

    Adding and removing roles is not something that you should need to do
    dynamically, but is more of an installation task. You may want to add people
    to roles, but usually those roles are fixed.

    Not being able to add a role within a transaction is documented in Books
    Online:
    mk:@MSITStore:C :\Program%20Fil es\Microsoft%20 SQL%20Server\80 \Tools\Books\ts q
    lref.chm::/ts_sp_addp_33s5 .htm

    I suggest you find out when/why your trasactions are started and why you are
    trying to create a role at that time! To do this you may want to use
    profiler.

    John


    "php newbie" <newtophp2000@y ahoo.com> wrote in message
    news:124f428e.0 405311620.4fa9a 98b@posting.goo gle.com...[color=blue]
    > Hello,
    >
    > I know there is sp_addrole and sp_droprole to create roles. I just
    > found out that I could not use these two statements in an application
    > because the application is interacting with the database within
    > transactions through ODBC (SQLServer complains that these two stored
    > procedures cannot be executed within transactions).
    >
    > Is there an alternative way of creating and dropping roles in plain
    > SQL?[/color]


    Comment

    Working...