title: T-SQL - function with default parameters
body: <p>I have this script:</p>
  
  <pre><code>CREATE FUNCTION dbo.CheckIfSFExists(@param1 INT, @param2 BIT = 1 )
  RETURNS BIT
  AS
  BEGIN
      IF EXISTS ( bla bla bla )
          RETURN 1;
      RETURN 0;
  END
  GO
  </code></pre>
  
  <p>I want to use it in a  procedure in this way:</p>
  
  <pre><code>IF dbo.CheckIfSFExists( 23 ) = 0
      SET @retValue = 'bla bla bla';
  </code></pre>
  
  <p>But I get the error:</p>
  
  <blockquote>
    <p>An insufficient number of arguments were supplied for the procedure or function dbo.CheckIfSFExists.</p>
  </blockquote>
  
  <p>Why does it not work?</p>