title: Trigger that only runs runs once per day
body: <p>This trigger backs up data from dbo.node to dbo.nodearchive. While backups are important, I only need to do this once per day. Note that there is a field called dbo.NodeArchive.versionDate (smalldDatetime). </p>
  
  <pre><code>CREATE TRIGGER [dbo].[Node_update] 
  ON  [dbo].[Node]
  for UPDATE
  
  AS 
  BEGIN
  INSERT INTO dbo.NodeArchive ([NodeID]
    ,[ParentNodeID]
    ,[Slug]
    ,[xmlTitle]
  ...    
    ,[ModifyBy]
    ,[ModifyDate]
    ,[CreateBy]
    ,[CreateDate])
  
  SELECT [deleted].[NodeID]
    ,[deleted].[ParentNodeID]
    ,[deleted].[Slug]
    ,[deleted].[xmlTitle]
  ...  
    ,[deleted].[ModifyBy]
    ,[deleted].[ModifyDate]
    ,[deleted].[CreateBy]
    ,[deleted].[CreateDate]
  FROM  [deleted] LEFT JOIN dbo.Node
  ON  [deleted].NodeID = dbo.Node.NodeID
  WHERE deleted.ModifyDate &lt;&gt; dbo.Node.ModifyDate
  END
  GO
  </code></pre>
  
  <p>I am looking to backup changes, but never more than one backup version per day. If there is no change, there is no backup. </p>