title: How to print GETDATE() in SQL Server with milliseconds in time?
body: <p>I want to print <a href="https://docs.microsoft.com/en-us/sql/t-sql/functions/getdate-transact-sql?view=sql-server-2017" rel="noreferrer">GETDATE()</a> in SQL Server 2008, I need the time with milliseconds (this is for debugging purpose - to find sp's execution time )</p>
  
  <p>I find this Difference </p>
  
  <ul>
  <li><code>SELECT GETDATE()</code> returns <strong>2011-03-15 18:43:44.100</strong> </li>
  <li><code>print GETDATE()</code> returns <strong>Mar 15 2011  6:44PM</strong></li>
  </ul>
  
  <p>I think SQL Server automatically typecast in print functionality.</p>
  
  <p>I need to print the date like this <code>2011-03-15 18:43:44.100</code></p>
  
  <p>Thanks for your help.</p>