首页 > SQL Server 2005创建远程登录帐户的SQL语句

SQL Server 2005创建远程登录帐户的SQL语句

/*创建服务器登录角色*/
CREATE LOGIN xyz WITH PASSWORD='xyz123'
/*打开指定数据库*/
USE [job]
GO
/*创建数据库角色 并关联服务器登录角色*/
CREATE USER xyz FOR LOGIN xyz
/*赋予某个表给角色权限*/
GRANT SELECT ON ServerAttachments TO xyz
GRANT SELECT ON ServerCompanies TO xyz
GRANT SELECT ON ServerDocument TO xyz
GRANT SELECT ON ServerFrontUsers TO xyz
GRANT SELECT ON ServerJobPostings TO xyz
GRANT SELECT ON ServerRecommendedCompanies TO xyz
GRANT SELECT ON ServerRecommendedPostings TO xyz
GRANT SELECT ON ServerCompanyJobPostingUpdate TO xyz
MSSQL推荐