• The application developer cannot provide me with a copy of a PHP .ini file. The claim is that none exist. I'm waiting for verification of that. This is based on what is addressed at:

    http://social.technet.microsoft.com/wiki/contents/articles/1258.accessing-sql-server-databases-from-php.aspx

    In the meantime, I changed the trigger to SET the various options inside the create trigger statement. This was based on what was returned in the SQL Server Error Log:

    CREATE TRIGGER [CaptureLogonInfo]

    ON ALL SERVER WITH EXECUTE AS 'DatabaseLogonAuditUser'

    AFTER LOGON

    AS

    SET ANSI_NULLS ON

    SET QUOTED_IDENTIFIER ON

    SET ANSI_PADDING ON

    SET ANSI_WARNINGS ON

    SET CONCAT_NULL_YIELDS_NULL ON

    BEGIN

    ...

    This got me past the failure of the application.

    I added RAISERROR code to check if I was even getting into the trigger from PHP:

    DECLARE @SessionIDINT,

    @LoginTimeDATETIME,

    @LoginNameVARCHAR(128),

    @DBNamevarchar(128),

    @ErrorTextvarchar(1000)

    SELECT@SessionID = EVENTDATA().value('(/EVENT_INSTANCE/SPID)[1]', 'int'),

    @LoginTime = EVENTDATA().value('(/EVENT_INSTANCE/PostTime)[1]', 'nvarchar(128)'),

    @LoginName = EVENTDATA().value('(/EVENT_INSTANCE/LoginName)[1]', 'nvarchar(128)'),

    @DBname = ORIGINAL_DB_NAME ()

    SET @ErrorText = 'Outside IF statement for DatabaseLogonAuditUse trigger ' + @DBName

    RAISERROR (@ErrorText, -- Message text.

    10, -- Severity,

    1, -- State,

    7, -- First argument used for width.

    3, -- Second argument used for precision.

    N'SEL') -- Third argument supplies the string.

    WITH LOG

    For all other applications, except the one PHP we have, this works fine and I log the message/db name in the SQL Server logs.

    Since I feel this is a PHP issue, I'm going to concentrate from that end.

    Thanks, everyone!