开发者

SQL Server User table permissions

What is the SQL Server script to create a user and set table permissions to that user?

  1. Create user using script
  2. 开发者_如何学编程
  3. 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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜