Logging update operation in triggers
===

I have an UPDATE trigger that produce INSERTED and DELETED table like this

INSERTED

    Id	Name	Surname
    1	Stack	Overflow
    2	Luigi	Saggese


DELETED

    Id	Name	Surname
    1	Stacks	Overflow
    2	Luigi	Sag


I want to LOG this operation. My Log table (that is unique for all tables) is like this (then i must process my INSERTED and DELETED table):

    Id_Table	Table_Key_Value	  Id_Value	 Old_Value	New_Value
    12345	            1	       4556645	  Stack	     Stacks
    12345	            1       	544589   Overflow	Overflows
    12345	            2	        544589	 Saggese	   Sag

to make where Id_Table is Table's system object_id where i have performe UPDATE statement, Table_Key_Value is tha value of key where i have performe UPDATE, Id_Value is system object_id of column that i have changed (just if column is changed during UPDATE operation).

I have thought 2 ways to do that:

 1. Performing **n SELECT** on TABLE for each COLUMN like this 

    INSERT INTO LOG (Id_Table, Table_Key_Value, Id_Value,Old_Value, New_Value)
    
    SELECT 12345, Id, 4556645, D.Name, I.Name
        
    FROM INSERTED I 
    
    INNER JOIN DELETED D ON I.ID = D.ID
           
    WHERE D.Name<>I.Name

  union
    
    SELECT 12345, Id, 544589, D.Surname, I.Surname
        
    FROM INSERTED I 
    
    INNER JOIN DELETED D ON I.ID = D.ID
           
    WHERE D.Surname<>I.Surname

 2. Performing **1 SELECT** with a **FUNCTION** like this

    SELECT CustomFunction(12345,Id, I.Name, D.Name, I.Surname, D.Surname) 
    FROM INSERTED I  INNER JOIN DELETED D ON I.ID = D.ID

    **CustomFunction** (_Id_Table,_Table_Key_Value, _Old_Value_Name, _New_Value_Name, _Old_Value_Surname, _New_Value_Surname)

    INSERT INTO LOG(Id_Table, Table_Key_Value, Id_Value,Old_Value, New_Value)
    VALUES(_Id_Table,_Table_Key_Value, 4556645, _Old_Value_Name, _New_Value_Name)

    INSERT INTO LOG(Id_Table, Table_Key_Value, Id_Value,Old_Value, New_Value)
    VALUES(_Id_Table,_Table_Key_Value, 544589, _Old_Value_Surname, _New_Value_Surname)

There are other ways to do that? 
What is most efficient and maintainable between those?