title: How to get the epoch time in SQL Server?
body: <p>The scenario is this:
   select max date from some table, when the target table having no data, so the max date is null. when the date being null, I want to get the earliest date of system, so the epoch time seems perfect.</p>
  
  <p>I have searched some ways including DATEADD functions, but that seems not elegant.</p>