Reputation: 13
What is the SQL Server script to create a user and set table permissions to that user?
Upvotes: 1
Views: 1180
Reputation: 5885
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.
Upvotes: 2