SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Application Roles


Application Roles

Author
Message
Site Owners
Site Owners
SSChampion
SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)SSChampion (12K reputation)

Group: Administrators
Points: 12769 Visits: 26
Comments posted to this topic are about the item Application Roles
Joshua M Perry
Joshua M Perry
SSC Eights!
SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)

Group: General Forum Members
Points: 826 Visits: 551
The answer is absolutely wrong. You can't use sp_unsetapprole because the cookie was never set using sp_setapprole. If you activate the app role before setting the cookie using sp_setapprole, you can only get the original context by disconnecting and reconnecting. sp_unsetapprole only works if you first use sp_setapprole to create the cookie.

"You are testing an application role in SQL Server 2005. You connect with SSMS, invoke the role, and then execute various queries and stored procedures. What can you do to return to your normal account permissions? (select all that apply)"

Joshua Perry
http://www.greenarrow.net
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99958 Visits: 39000
Joshua Perry (3/19/2008)
The answer is absolutely wrong. You can't use sp_unsetapprole because the cookie was never set using sp_setapprole. If you activate the app role before setting the cookie using sp_setapprole, you can only get the original context by disconnecting and reconnecting. sp_unsetapprole only works if you first use sp_setapprole to create the cookie.

"You are testing an application role in SQL Server 2005. You connect with SSMS, invoke the role, and then execute various queries and stored procedures. What can you do to return to your normal account permissions? (select all that apply)"


Actually, you invoke the role using sp_setapprole, so you can use sp_unsetapprole to revert to your original context. If there is another way to invoke an application role without using sp_setapprole, I'd like to know what it is.

Cool

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Joshua M Perry
Joshua M Perry
SSC Eights!
SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)

Group: General Forum Members
Points: 826 Visits: 551
The question never says anything about actually using sp_setapprole to create the cookie, so you can't use sp_unsetapprole to revert. I think you need to read my post again. You have to specify the option to create the cookie to be able to revert.

EXEC sp_setapprole 'user', 'password', @fCreateCookie = true, @cookie = @cookie OUTPUT

EXEC sp_unsetapprole @cookie

Joshua Perry
http://www.greenarrow.net
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99958 Visits: 39000
I did, and here is the question again with emphasis added.

"You are testing an application role in SQL Server 2005. You connect with SSMS, invoke the role, and then execute various queries and stored procedures. What can you do to return to your normal account permissions? (select all that apply)"


It clearly states that the approle is invoked, this means you had to use the sp_setapprole to invoke the role for testing. Maybe the question could have been clearer if written as such:

"You are testing an application role in SQL Server 2005. You connect with SSMS, invoke the role using sp_setapprole, and then execute various queries and stored procedures. What can you do to return to your normal account permissions? (select all that apply)"


Sometimes you do have to read between the lines.

Cool

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
kevin.l.williams
kevin.l.williams
Hall of Fame
Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)Hall of Fame (3.7K reputation)

Group: General Forum Members
Points: 3659 Visits: 1323
Joshua,

The issue is that the ”invoke the role” statement in the question is vague and I belive assumes that the @fCreateCookie and @cookie arguments were used.

-Kevin



Matt Miller (4)
Matt Miller (4)
SSC-Dedicated
SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)SSC-Dedicated (30K reputation)

Group: General Forum Members
Points: 30981 Visits: 19011
Joshua - from the question itself:


You are testing an application role in SQL Server 2005. You connect with SSMS, invoke the role, and then execute various queries and stored procedures


You can only "invoke the role" with sp_setapprole. The question is worded just so that it doesn't steer you to the answer. No - it doesn't specifically mention sp_setapprole, but that's on purpose, and IMO - not incorrect at all.

Besides - it covers both alternatives. if the cookie isn't set, then you have to disconnect and reconnect to get your permissions; if the cookie is set, then you can use sp_unsetapprole.

----------------------------------------------------------------------------------
Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?
Joshua M Perry
Joshua M Perry
SSC Eights!
SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)

Group: General Forum Members
Points: 826 Visits: 551
Again, setting the cookie is an option that is required to revert. By default this option is set to false. The question is about how to revert and the cookie is an important piece. Without the cookie you cannot revert to the original context.

Joshua Perry
http://www.greenarrow.net
Lynn Pettis
Lynn Pettis
SSC Guru
SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)SSC Guru (99K reputation)

Group: General Forum Members
Points: 99958 Visits: 39000
Joshua - Read the whole question. It clearly states that you invoke the approle. How do you do that? You use sp_setapprole, therefore you are setting everything up to be able to revert using sp_unsetapprole.

Please, tell me if there is ANY other way to invoke an application role with out using sp_setapprole, as I am not aware of it.

Cool

Cool
Lynn Pettis

For better assistance in answering your questions, click here
For tips to get better help with Performance Problems, click here
For Running Totals and its variations, click here or when working with partitioned tables
For more about Tally Tables, click here
For more about Cross Tabs and Pivots, click here and here
Managing Transaction Logs

SQL Musings from the Desert Fountain Valley SQL (My Mirror Blog)
Joshua M Perry
Joshua M Perry
SSC Eights!
SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)SSC Eights! (826 reputation)

Group: General Forum Members
Points: 826 Visits: 551
You are correct that you must use sp_setapprole to invoke the app role, but if you do this without setting the cookie you cannot revert since the cookie is what allows you to revert. Where does it say anything about setting the cookie option? That's why you can only reconnect to revert to the original context. If you don't believe me just try it yourself.

Joshua Perry
http://www.greenarrow.net
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search