tediousjs / tedious

Node TDS module for connecting to SQL Server databases.
http://tediousjs.github.io/tedious/
MIT License
1.58k stars 438 forks source link

EVENTDATA().value in logon trigger #1371

Open ramgee-da opened 2 years ago

ramgee-da commented 2 years ago

error 'logon failed due to logon trigger' occurs when EVENTDATA() exists in logon trigger ex) USE [master] GO ALTER TRIGGER [block_ipaddress] ON ALL SERVER FOR LOGON AS BEGIN SET ANSI_NULLS ON SET QUOTED_IDENTIFIER ON

        SET ANSI_PADDING ON
        DECLARE @capturedip NVARCHAR(15)
        SET @capturedip = EVENTDATA().value('(/EVENT_INSTANCE/ClientHost)[1]', 'NVARCHAR(15)') 

END GO

error occurs due to 'SET @capturedip = EVENTDATA().value('(/EVENT_INSTANCE/ClientHost)[1]', 'NVARCHAR(15)') ',

How can I solve this issue

MichaelSun90 commented 2 years ago

Hi @ramgee-da, is this a repeated question of issue #1370 or do you have some other questions about this topic? If this is a repeated question that was submitted by an accident, can you please close this? Thanks!