Here's the scenario we want to achieve -
1) Login authenticates to SQL instance
2) Login becomes a user in the XYZ database
3) Some sort of code fires when a login becomes a user in the XYZ database - maybe it's for auditing purposes, or it could be for features unlocking in a web site, or it might be for license enforcement in software. The point is that we want to fire what effectively amounts to trigger code when a user account is activated in a database.
This isn't a logon trigger but it's roughly the same concept, just at the database-level scope. If we tried to do this in a logon trigger, then it would not detect later in a session when the user issued the "USE XYZ" statement. So basically we're trying to fire trigger-like code whenever a user account is used.
Any suggestions? Thank you!