1

I am facing problem regarding database permissions. I have created my database named FCProject. I created a login for that database in SQL Server Management Studio. My login is working fine but all I want to restrict access to FCProject database through users who can log in to SQL Server through Windows authentication mode.

Because I want only FC login to be able to view or modify data of FC database in SQL Server Management Studio.

I have tried creating a login through Management Studio. Is there any problem in creating login? Or something else? Please help

1 Answer 1

1

You are mixing up two things that should be kept separate here:

  1. A login is on the server level - it gives an account (a Windows account, or a SQL Server specific account) the permission to connect to this server

  2. Each database can then define user for its own use - based on those logins.

So in your case, what you need to do is to:

  1. create a number of logins on the server-level
  2. create users in your FCLogin database for just those logins

and then you're fine - only those accounts that you've defined explicitly can access your FCLogin database and use it.

See the Stairway to SQL Server security series of articles on SQL Server Central (very well worth registering for their contents!) which explains all the ins and outs in great detail

Sign up to request clarification or add additional context in comments.

6 Comments

what is meant by Login on Server Level?
As I tried to explain: a login is for the whole server (not a single database) - once you have a login, then you can define one or more user for your database in question
i have a login named FC , now where i can define FC user for my FCProject database?
@WaqasAli: in your SQL Server Mgmt Studio, go to the FCLogin database, and under FCLogin > Security > Users you can define the database users based on your logins
i have defined there my Login FC, but i am also accessing database FCProject when i log in through windows authentication mode. i want it to be only accessed when i log in through FCLogin
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.