create trigger dbevent on dbo.assetallocation for Insert,Update as declare @accountid varchar(50) begin set @accountid = (select accountid from inserted); INSERT INTO dbeventtriggertable VALUES ('Query = WHERE accountid ='''+@accountid +''' ' ); END ;