数据库中,限制用户只能访问一个数据库

database

USE master;

GO

--Step 1: (create a new user)

create LOGIN hello WITH PASSWORD="foo", CHECK_POLICY = OFF;

-- Step 2:(deny view to any database)

USE master;

GO

DENY VIEW ANY DATABASE TO hello;

-- step 3 (then authorized the user for that specific database , you have to use the master by doing use master as below)

USE master;

GO

ALTER AUTHORIZATION ON DATABASE::yourDB TO hello;

GO

https://stackoverflow.com/questions/4085700/restrict-sql-server-login-access-to-only-one-database

 

以上是 数据库中,限制用户只能访问一个数据库 的全部内容, 来源链接: utcz.com/z/533151.html

回到顶部