DEFINITIONS

Definitions More Info.
Definition ID980
TitleSQL
CategoryNOTES
DefinitionDisable all logon
Definition DescriptionCREATE TRIGGER [DISABLE_LOGON_APP]
ON ALL SERVER
FOR LOGON
AS
BEGIN

DECLARE @program_name nvarchar(128)
DECLARE @host_name nvarchar(128)

SELECT @program_name = program_name,
@host_name = host_name
FROM sys.dm_exec_sessions AS c
WHERE c.session_id = @@spid


IF ORIGINAL_LOGIN() IN('sqluser1','sqluser2','testuser')
AND @program_name LIKE '%Management%Studio%'
BEGIN
RAISERROR('This login is for application use only.',16,1)
ROLLBACK;
END
RecordBycunay
Record Date29-09-2019 09:36:05
Düzenle
Kopyala
Sil