- MS SQL Server - Analysis Services
- MS SQL Server - Integration Services
- MS SQL Server - Execution Plans
- MS SQL Server - Reporting services
- MS SQL Server - HA Technologies
- MS SQL Server - Services
- MS SQL Server - Monitor Database
- MS SQL Server - Assign Permissions
- MS SQL Server - Create Users
- MS SQL Server - Restoring Databases
- MS SQL Server - Creating Backups
- MS SQL Server - Drop Database
- MS SQL Server - Select Database
- MS SQL Server - Create Database
- MS SQL Server – Login Database
- MS SQL Server – Managment Studio
- MS SQL Server – Architecture
- MS SQL Server – Installation
- MS SQL Server – Editions
- MS SQL Server - Overview
- MS SQL Server - Home
MS SQL Server Useful Resources
Selected Reading
- Who is Who
- Computer Glossary
- HR Interview Questions
- Effective Resume Writing
- Questions and Answers
- UPSC IAS Exams Notes
MS SQL Server - Assign Permissions
Permissions refer to the rules governing the levels of access that principals have to securables. You can grant, revoke and deny permissions in MS SQL Server.
To assign permissions either of the following two methods can be used.
Method 1 – Using T-SQL
Syntax
Use <database name> Grant <permission name> on <object name> to <usernameprinciple>
Example
To assign select permission to a user called TestUser on object called TestTable in TestDB database, run the following query.
USE TestDB GO Grant select on TestTable to TestUser
Method 2 – Using SSMS (SQL Server Management Studio)
Step 1 − Connect to instance and expand folders as shown in the following snapshot.
Step 2 − Right-cpck on TestUser and cpck Properties. The following screen appears.
Step 3 Cpck Search and select specific options. Cpck Object types, select tables and cpck browse. Select TestTable and cpck OK. The following screen appears.
Step 4 Select checkbox for Grant column under Select permission and cpck OK as shown in the above snapshot.
Step 5 Select permission on TestTable of TestDB database granted to TestUser . Cpck OK.
Advertisements