How to GRANT permissions to a SQL role to create and manage temp tables

后端 未结 3 535
猫巷女王i
猫巷女王i 2021-01-20 03:43

I\'d like to grant permissions to a SQL role to create a temp table #foo and grant permissions to do anything with that table (SELECT, INSERT and DELETE). How is it possible

3条回答
  •  遇见更好的自我
    2021-01-20 04:41

    You can't:

    Global temporary tables are automatically dropped when the session that created the table ends and all other tasks have stopped referencing them. The association between a task and a table is maintained only for the life of a single Transact-SQL statement. This means that a global temporary table is dropped at the completion of the last Transact-SQL statement that was actively referencing the table when the creating session ended. link text

提交回复
热议问题