22,297
社区成员




-- 具体步骤(SQL 2005)
create login [test] with password='';
go
use NorthwindSecure;
go
create user [test] from login [test];
go
grant select on dbo.Region to [test];
go
-- 测试
execute as user='test';
select SUSER_NAME() loginame,USER_NAME() username;
select * from dbo.Region;
revert;
sp_helplogins 'TestAccount'
--以下示例授予用户 TestAccount 对 NorthwindSecure 数据库中表 dbo.Region 的 SELECT 权限。
USE NorthwindSecure ;
GRANT SELECT ON OBJECT::dbo.Region TO TestAccount ;
GO