I am trying to create a set of users in Sql server 2008 SP1 with access to database for any specific time say 12:00AM to 6:00AM . If that user try to access the database before 12:00AM or after 6:00AM the access shall be denied is there any inbuild feature for user management available.
Thanks,
Atul
You can create a logon trigger that denies them the ability to connect to between those times, but there’s no simple way to cut off their access if they stay longer than desired.
One ugly way to do it would be to examine all connections at 6 am, and for those coming from people you no longer want connected, issuing a
KILLcommand. But that would be a very “abrupt” experience for those users – any transactions that were still in progress at that time would be rolled back.