Click here to Skip to main content
15,888,401 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
Dear ALL,
How to set Password for Database in Sql Server Managment studio???
for example i have a database by name : dbShop
how to set password for dbShop.
no one can access it.

please help me.
Posted

See Create a Login[^] and Create a Database User[^] at MSDN (you need both).
 
Share this answer
 
Comments
_Amy 8-Sep-14 6:46am    
+5! :)
MariwanIT 8-Sep-14 6:51am    
Dear CPallini,

I have Windows Authentication and Sql Server Authentication,

I want to disable login Winodws then set password for sql server.

but when i try to get the connection in c# it said login for SSD-PC\SSD is disabled ...
How can fix this problem

I appreciate your help
_Amy 8-Sep-14 7:11am    
Check Solution 3[^].
MariwanIT 8-Sep-14 7:31am    
Dear I have a database(dbShop) in my SQL DBMS , but windows user can delete, edit it. I want to crate adifferent user with password to access that dbShop. how can do it??
To enable the specific login, follow the steps:
  • Expand the SQL Server
  • Expand Security node
  • Select the Particular Login (User)
  • Press right button and select properties of the login
  • Go to Status table Enable the User


Then try to login.

Refer Login failed for user 'username'. Reason: The account is disabled.[^]

--Amy
 
Share this answer
 
Comments
MariwanIT 8-Sep-14 7:16am    
my question is how to set password for my db in sql sever . just specific user can log in and edit the db entries.
_Amy 8-Sep-14 7:22am    
Are you talking about access restriction for anonymous users?
See SQL SERVER – Understanding Restrict Access to Restricted_User Database Property[^].
MariwanIT 8-Sep-14 7:33am    
Dear I have a database(dbShop) in my SQL DBMS , but windows user can delete, edit it. I want to crate adifferent user with password to access that dbShop. how can do it??
_Amy 8-Sep-14 7:58am    
That is already there in 1st solution.
According to your comment, I've given the answer. Please read the comment in 1st Accepted Solution.
create sql server >> login use sql user >> create database and select sql user.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900