快速新建SQL相同权限账号
1. 先得到旧帐号bbsc的权限:
sp_helprotect null,'bbsc'
Owner |
Object |
Grantee |
Grantor |
ProtectType |
Action |
Column |
dbo |
WSCParameter |
bbsc |
dbo |
Grant |
Select |
(All+New) |
dbo |
WSCParameterType |
bbsc |
dbo |
Grant |
Select |
(All+New) |
dbo |
WSCTeam |
bbsc |
dbo |
Grant |
Select |
(All+New) |
dbo |
WSCUserTeamMap |
bbsc |
dbo |
Grant |
Select |
(All+New) |
PMS |
v_PMSITEMViewForHI4 |
bbsc |
PMS |
Grant |
Select |
(All) |
2. 生成Grant脚本,将权限赋予新帐号anny:
Grant
Select |
ON |
dbo |
. |
WSCParameter |
TO |
anny | |
Grant |
Select |
ON |
dbo |
. |
WSCParameterType |
TO |
anny |
Grant |
Select |
ON |
dbo |
. |
WSCTeam |
TO |
anny |
Grant |
Select |
ON |
dbo |
. |
WSCUserTeamMap |
TO |
anny |
Grant |
Select |
ON |
PMS |
. |
v_PMSITEMViewForHI4 |
TO |
anny |
将dbo和.后面的空格去掉执行即可,SELECT不是一定的,对照上表Action的值!