Click here to Skip to main content
15,891,923 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Is it possible to create new login name and password for existing sql server database (for single db) and to restrict only sql server authentication using c#.net code?
If yes then how to do it using c# code and if not then how to secure my database from other users?

Thanks in advance
Posted

1 solution

Then check out CREATE LOGIN (Transact-SQL)[^]

To grant access to user on database.
GRANT Database Permissions (Transact-SQL)[^]
 
Share this answer
 
v2
Comments
Shreyajit 29-Jul-11 6:41am    
its working but using default windows authentication we can access it and since sa is admin account so it is also accessible to sa too.
Is it possible except sa account my database should not be visible to any other account and also not to windows authentication too.?
Kim Togo 29-Jul-11 6:48am    
To change permissions on database for a specific user. Then you use GRANT sql.

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