Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Can we make use of user without login.. Expand / Collapse
Author
Message
Posted Friday, August 16, 2013 3:14 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, June 27, 2014 6:10 AM
Points: 104, Visits: 400
Hi All,

Can you please suggest...Can we create user without login and what is the use for this if we can create user without login...



Post #1485047
Posted Friday, August 16, 2013 4:40 AM


Right there with Babe

Right there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with BabeRight there with Babe

Group: General Forum Members
Last Login: Yesterday @ 2:28 PM
Points: 786, Visits: 691
Yes, you can say:

CREATE USER Nisse WITHOUT LOGIN

Like any good feature, this has a multitude of use cases. Here are a few:

1) You don't want to grant end users direct access to SQL Server, so you use an application login. However, you want to be able to audit who is doing what, why the application performs EXECUTE AS = 'User' and you create loginless users in the the database.

2) You want to use the EXECUTE AS clause to package permissions in stored procedure. Rather than the casual EXECUTE AS OWNER, you should use EXECUTE AS 'loginlessuser' where the user has only been granted the permissions needed to run the stored procedure.

3) You use Service Broker and activation procedures which you want to run in a controlled context. Loginless users which has been granted restricted rights come in handy here.


Erland Sommarskog, SQL Server MVP, www.sommarskog.se
Post #1485094
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse