MSSQL https://thesqldude.com/2012/04/07/how-to-prevent-users-from-accessing-sql-server-from-any-application-or-any-login-expect-your-main-application-its-login/ Oracle http://nadvi.blogspot.com/2012/02/database-login-trigger-to-prevent.html