SQL server creates a user and authorizes a specific table to access the database

1. First create different login names for different vendors (take one vendor as an example below)

image

 

 

2. Add the login name to the public server role, and then click OK

image

 

3. Cancel the attribute of the public server role -> security object to view all databases

Open to access the database Dabase.XXX.OA that needs to be opened

SQL query

-Assign the material information table read-only select permission to user XXX 

grant select on material information table to XXX

-Assign the specified table permissions to the user (read, write, delete)
GRANT SELECT, INSERT, UPDATE, DELETE ON table1 TO [user name]

-Assign the column permissions of the specified table to the user (read-write delete)
GRANT SELECT, UPDATE ON table1(id,AA) TO [user name] 

 

Guess you like

Origin blog.csdn.net/kakak2000/article/details/105954482