This article is a mirror article of machine translation, please click here to jump to the original article.

View: 3107|Reply: 0

[Source] SQL Server uses scripts to create read-only accounts for a piece of data

[Copy link]
Posted on 11/10/2023 7:27:50 PM | | | |
Requirements: In the SQL Server database, create a new account and set read-only permissions on the [DBDemo] database, and do not allow modification of database records.


New SQL Server users are allowed to access only certain databases
https://www.itsvse.com/thread-10314-1-1.html

Mysql creates a read-only account
https://www.itsvse.com/thread-9332-1-1.html

The SQL script looks like this:

After executing the script, try to log in with a read-only account and test the query table data, as shown in the following figure:



Try updating the data in the table as shown in the following image:

itsvse_readonly
Message 229, Level 14, State 5, Line 9
UPDATE permission on object 'Tab1' (database 'DBDemo', schema 'dbo') was denied.

Completion time: 2023-11-10T19:27:03.1171056+08:00



(End)




Previous:The difference between UEFI and traditional BIOS (Legacy).
Next:Debian repository update prompts with a 404 error
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com