Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

Logon trigger

$
0
0
Hi Expert,

I am using below code for disabling user for from access through Management Studio:-

SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

CREATE TRIGGER [blocker]
ON ALL SERVER 
FOR LOGON

AS
BEGIN
if app_name() = 'Microsoft SQL Server Management Studio' and  (original_login() = 'Test' or original_login() = 'Test1' or originial_login = 'Test3')

Begin
rollback transaction
END
End

GO

SET ANSI_NULLS OFF
GO

SET QUOTED_IDENTIFIER OFF
GO

DISABLE TRIGGER [blocker] ON ALL SERVER
GO

--------------------



Same LoginID is used with other applications but I want to revoke access through SQL

After enable it i see performance impact on my server.so please tell me where am i doing wrong.

Thanks

Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>