Can we make use of user without login..

  • 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...

  • 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.

    [font="Times New Roman"]Erland Sommarskog, SQL Server MVP, www.sommarskog.se[/font]

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply