Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. COOoo, I love this solution. To explain it in a little more detail, Tom's saying that you would maintain a user table in master with your list of databases, roles, and users. Ideally, SQL Server would maintain this table for you with DDL triggers, but I don't know if you can set DDL triggers on some of the related system tables that you'd want. May have to update the list manually. Then have your Resource Governor classifier function query that table to get the right resource pool. Brilliant.
      singulars
    2. COThis might be the best solution, although you end up duplicating info between master and the user db and it sounds like an administrative headache. Not sure that I would approach it by creating triggers, since I would be concern that any triggers I put on system sprocs/tables could easily be overwritten by a patch. My approach would be to build a stored procedure in the master to live with the table and scan the sys.database_principals of the user databases and manage the lookup table. It might even be possible to call this synchronization sproc from within the classifier function itself.
      singulars
    3. COA function can't have any effect on an object outside of the function itself, so it wouldn't be possible to fill a permanent table that way. I think that if you tried to fill a temporary table within the function then you would have a problem with the fact that the function must be schema bound. That's going to cause problems with going across databases.
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload