title: Update function in TSQL trigger
body: <p>I have a question about TSQL function Update. For example, I have a table with a field Name. If I check if the field Name is changed or not in a After Update trigger likes this:</p>
  
  <pre><code>  if Update(Name)
    Begin
      -- process
    End
  </code></pre>
  
  <p>Will the Update still return TRUE even if Name is not changed? The following update statement will update it with the same value:</p>
  
  <pre><code>  SELECT @v_Name = Name From MyTable Where Id = 1;
    Update MyTable Set Name = @v_Name where Id = 1;
  </code></pre>
  
  <p>If the Update() returns TRUE even the value of Name is not changed, do I have to compare the value in the inserted and deleted virtual tables to find out if the value is really changed? </p>
  
  <p>By the way, the inserted and deleted are virtual tables and they may contain more than one rows of data if more than one rows of data are changed by one TSQL INSERT or UPDATE statement. In case of more than one records, are the count numbers of rows in inserted and deleted virtual tables the same and what is the real meaning of Update(Name) as TRUE? Does it mean that at least one is changed? Or does Update(Name) mean that the field of Name has been set by Update statement regardless if the value is changed?</p>
  
  <p>The SQL server I use is Microsoft SQL 2005.</p>