Skip to content
Tako Lee edited this page Mar 12, 2014 · 34 revisions

Parameter declaration

Parameter style
  • Fit into one line

    Option: fmt151_parameter_list_style = fit_into_one_line, type: TFmtListStyle.

    CREATE FUNCTION dbo.Fn_gettoporders(@custid AS INT,@n AS INT, @test AS CHAR)  
    RETURNS TABLE  
    AS  
      RETURN  
        SELECT TOP(@n) *  
        FROM   sales.salesorderheader  
        WHERE  customerid = @custid  
        ORDER  BY totaldue DESC  
    
    GO        
  • Stacked

    Option: fmt151_parameter_list_style = stacked, type: TFmtListStyle.

    CREATE FUNCTION dbo.Fn_gettoporders(
       @custid AS INT,
       @n AS INT, 
       @test AS CHAR)  
    RETURNS TABLE  
    AS  
      <function body>  
    GO        
  • Create function/procedure

  • IN and OUT keywords in parameter declaration

Parameter in function call
Clone this wiki locally