Share via

what kind of permissions do I need to grant to database user?

Huang, Winston-HR 320 Reputation points
2024-02-21T08:47:58.16+00:00

I want to back up tables from schema A to schema B and implement them through stored procedures. Use userA as an intermediate authorization to authenticate users. My thoughts are as follows: Grant the 'select' permission of schema A to userA, and grant the 'select, update, insert, delete' permissions of schema B to user A. Is the above permissions sufficient? What kind of permissions do I need to grant to userA?

Azure Synapse Analytics
Azure Synapse Analytics

An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.


Answer accepted by question author

Smaran Thoomu 35,375 Reputation points Microsoft External Staff Moderator
2024-02-21T10:13:25.9833333+00:00

Hi @Huang, Winston-HR ,

Thank you for using Microsoft Q&A platform and thanks for your question.

As I understand you're looking for the kind of permissions which is required for database user. If my understanding is incorrect, please let me know.

Azure Synapse Analytics uses role-based access control (RBAC) to manage permissions and access to resources.

To back up tables from schema A to schema B and implement them through stored procedures, you can grant the 'select' permission of schema A to userA, and grant the 'select, update, insert, delete' permissions of schema B to userA. This will allow userA to select data from schema A and perform all CRUD operations on schema B. This should be sufficient for your requirements.

To authenticate users through userA, you can create stored procedures in schema B that use userA's credentials to access schema A. You can then grant execute permissions on these stored procedures to the users who need to access the data.

Here are the steps to grant the required permissions to userA:

  • Connect to the database where schema A and schema B are located.
  • Execute the following command to grant 'select' permission of schema A to userA:
   GRANT SELECT ON schemaA TO userA;
   
  • Execute the following command to grant 'select, update, insert, delete' permissions of schema B to userA:
   GRANT SELECT, UPDATE, INSERT, DELETE ON schemaB TO userA;
   
  • Create stored procedures in schema B that use userA's credentials to access schema A.
  • Grant execute permissions on these stored procedures to the users who need to access the data.

Reference:

Hope this helps. Do let us know if you any further queries.


If this answers your query, do click Accept Answer and Yes for was this answer helpful. And, if you have any further query do let us know.

Was this answer helpful?

1 person found this answer helpful.

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.