SQL Server User table permissions
What is the SQL Server script to create a user and set table permissions to that user?
- Create user using script 开发者_如何学编程
- Set table permissions to that user using script
1) Creating a server login:
CREATE LOGIN AbolrousHazem
WITH PASSWORD = '340$Uuxwp7Mcxo7Khy';
2) Creating a corresponding database user:
USE AdventureWorks2008R2;
CREATE USER AbolrousHazem FOR LOGIN AbolrousHazem;
3) Granting to select from a table:
GRANT SELECT ON TableName TO AbolrousHazem
Follow the provided links to get more information.
精彩评论