simadi
use master
GO
EXEC sp_addlogin \'infos1\', \'1\', \'master\'
exec sp_grantdbaccess \'infos311\' -- 给访问权限
USE [UniMessage];
grant select,insert,update,delete to [infos311]
GO

-- 创建用户 
create login [infos1] with password=\'1\'; 
go
use [UniMessage]; 
go 
create user [infos1] from login [infos1]; 
go   
grant select,insert,update,delete  to [infos1]; 
go   -- 测试 
execute as user=\'test1\'; 
select SUSER_NAME() loginame,USER_NAME() username; 
--select * from dbo.Region; 
revert;
use master
GO
--USE [UniMessage];
exec sp_droplogin \'infos2\'
EXEC sp_helpuser \'dbo\'

 

分类:

技术点:

相关文章:

  • 2022-12-23
  • 2022-02-09
  • 2021-11-12
  • 2022-12-23
  • 2021-12-05
  • 2022-12-23
  • 2021-11-23
猜你喜欢
  • 2021-07-12
  • 2021-11-23
  • 2021-11-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
相关资源
相似解决方案