欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

sql2005创建远程登录帐户的sql语句

程序员文章站 2022-06-04 23:12:20
复制代码 代码如下: /*创建服务器登录角色*/ create login hnjm with password='hnjmxy123' /*打开指定数据库*/ use [...
复制代码 代码如下:

/*创建服务器登录角色*/
create login hnjm with password='hnjmxy123'
/*打开指定数据库*/
use [job]
go
/*创建数据库角色 并关联服务器登录角色*/
create user hnjm for login hnjm
/*赋予某个表给角色权限*/
grant select on serverattachments to hnjm
grant select on servercompanies to hnjm
grant select on serverdocument to hnjm
grant select on serverfrontusers to hnjm
grant select on serverjobpostings to hnjm
grant select on serverrecommendedcompanies to hnjm
grant select on serverrecommendedpostings to hnjm
grant select on servercompanyjobpostingupdate to hnjm