title: SQL Function without input parameters
body: <p>How to create a SQL Function <strong>without</strong> input parameters </p>
  
  <p>Im geting a error for following code</p>
  
  <pre><code>create function function_name 
  RETURN datetime AS 
  BEGIN 
  DECLARE @var datetime
  SELECT  @var=CURRENT_TIMESTAMP 
  RETURN @var
  END
  </code></pre>
  
  <p><strong>Error</strong> </p>
  
  <pre><code>&gt; 
  &gt; Msg 156, Level 15, State 1, Procedure
  &gt; fx_getcurrent_date, Line 2 Incorrect
  &gt; syntax near the keyword 'RETURN'. Msg
  &gt; 178, Level 15, State 1, Procedure
  &gt; fx_getcurrent_date, Line 7 A RETURN
  &gt; statement with a return value cannot
  &gt; be used in this context.
  </code></pre>