For SQL Server 2005 and up you can add a DDL trigger, like:
CREATE TRIGGER [YourDatabaseTrigger]
ON DATABASE
FOR DDL_EVENTS
AS
DECLARE @EventData xml
DECLARE @Message varchar(1000)
SET @EventData=EVENTDATA()
INSERT INTO YourLogTable
(EventDateTime,EventDescription)
VALUES (GETDATE(),SUSER_NAME()
+'; '[email protected]('(/EVENT_INSTANCE/ObjectType)[1]', 'varchar(250)')
+'; '[email protected]('(/EVENT_INSTANCE/ObjectName)[1]', 'varchar(250)')
+'; '[email protected]('(/EVENT_INSTANCE/TSQLCommand/CommandText)[1]','nvarchar(max)')
)
RETURN
GO
ENABLE TRIGGER [YourDatabaseTrigger] ON DATABASE
You would then need to create an triggers (for INSERT/UPDATE/DELETE) on each table in the database that would insert into the same table:
CREATE TRIGGER YourTableTrigger On YourTable
FOR INSERT
AS
INSERT INTO YourLogTable
(EventDateTime,EventDescription)
SELECT GETDATE(),SUSER_NAME()
+'; INSERT YourTable'+
+'; data='+...your column data here...
FROM INSERTED
GO