代碼如下:
/*創建服務器登錄角色*/
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