I get the error message below while posting an answer-
Not sure if this is the correct place to post this question.
Update: I was able to post the answer fine when I removed 15 lines of text. Is there a char limit for answers?
EDIT: Here is the part of answer that was causing the issue. I still cannot add that text to this question. So attaching an image of the code
Update: Copied code from srutzky's answer below and pasted it and it worked.
CREATE TRIGGER [TR_CaptureDBChanges] ON DATABASE
FOR CREATE_PROCEDURE, ALTER_PROCEDURE,DROP_PROCEDURE,
CREATE_TABLE, ALTER_TABLE,DROP_TABLE,CREATE_TRIGGER,
ALTER_TRIGGER,DROP_TRIGGER,CREATE_VIEW,ALTER_VIEW,
DROP_VIEW, CREATE_FUNCTION, ALTER_FUNCTION, DROP_FUNCTION
AS
BEGIN DECLARE @ed XML SET @ed = EVENTDATA()
DECLARE @ip VARCHAR(32) = (SELECT client_net_address
FROM sys.dm_exec_connections WHERE session_id = @@SPID);
INSERT INTO DBChangesLogs
( EventDate,DBName)VALUES(GetDate(),
@ed.value('(/EVENT_INSTANCE/DatabaseName)[1]', 'varchar(256)'))
END