Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 how can we execute the system stored procedure

Author  Topic 

boreddy
Posting Yak Master

172 Posts

Posted - 2009-03-11 : 01:51:45
How can we execute system stored procedure with in transaction
exp
BEGIN transaction
exec sys.sp_setapprole 'SteelNetRole','123$Naia'
COMMIT TRANSACTION

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-11 : 02:32:07
Why do you want to?

If the password supplied is not correct it will not activate the application role and you will not be able to access any objects. You can capture the output of sp_setapprole to see if it was successful or not...

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page

boreddy
Posting Yak Master

172 Posts

Posted - 2009-03-11 : 02:53:11
i am exicuting he sysprocedure into the my own procedure which perform many action with the transactions
Go to Top of Page

guptam
Posting Yak Master

161 Posts

Posted - 2009-03-11 : 03:19:38
hmm. I would say set it, start your transaction; commit or roll it back. Then unset it...

I have never tried to wrap that in transaction... Sorry.

Mohit.

--
Mohit K. Gupta
B.Sc. CS, Minor Japanese
MCITP: Database Administrator
MCTS: SQL Server 2005
http://sqllearnings.blogspot.com/
Go to Top of Page
   

- Advertisement -