Is it possible to grant permissions to a user for just a certain period of time? For example, I ran into a situation the other day where I wanted to grant a user the ability to modify data in a table for only a couple hours. I haven't found a native way to do this, but thought I'd ask anyway. This would be specifically for Azure SQL Database.
Sql-server – Granting Permissions for a limited period of time
azure-sql-databasesql server
Related Question
- SQL Server – How to GRANT SELECT on Hidden Resource Database mssqlsystemresource
- SQL Server Hierarchical Permissions – Managing Permissions in a Table Stored Hierarchy
- Sql-server – way to restrict automatic statistics updates to a certain timeframe
- Sql-server – Does a user who has permissions to select from a view also need select granted to the children entities of that view
- Sql-server – SQL 2008 permissions – cumulative or not
- Azure SQL Database – User Cannot Select from Table with SELECT Permissions
Best Answer
A very simple approach would be to open up an SSMS query window that's connected to the instance you want and use either WAITFOR DELAY or WAITFOR TIME
or ------
You could even include TSQL code to send you an email indicating the process had completed.
Keep in mind that if your SSMS session dies for any reason, the revoke code will not be executed.
A more robust (and more complex) solution would be to use Service Broker BEGIN CONVERSATION TIMER