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%20Files\Microsoft%20SQL%2 0Server\80\Tools\Books\tsq
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" <ne**********@yahoo.com> wrote in message
news:12**************************@posting.google.c om...
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?