sql server create a read-only users to access the specified table

 

Exec sp_addlogin ' username ' , ' password ' , ' database ' 
Go 
 
use database
 Exec sp_grantdbaccess ' username ' 
Go 

use database
 Grant  the SELECT  
ON table name
 to "user name"

 

exec sp_addlogin 'username', 'password', 'database' go use database exec sp_grantdbaccess 'username' Go
use grant select on the database table name to "user name"

Guess you like

Origin www.cnblogs.com/guohu/p/12425890.html