title: SQL Function error [invalid use of side-effecting operator 'select' within a function]
body: <p>Can any one help me to create function in sql server 2012 ,I M new in sql it shows error [invalid use of side-effecting operator 'select' within a function]</p>
  
  <pre><code>CREATE FUNCTION Get_RearEnd_Outflow( @I_TXN_ID INT)
  RETURNS int
  AS BEGIN
    DECLARE @V_COUNT INT
    SELECT COUNT(*) INTO @V_COUNT FROM IRR_CHARGES_M
    RETURN @V_COUNT
  END
  </code></pre>