General SQL Parser and SQL Pretty Printer Formatter options

Index

Available format options for parameters in create function/procedure:

Parameters_Style Type: TAlignStyle Default: asStacked
Parameters_Comma Type: TLinefeedsCommaOption Default: lfAfterComma
BEStyle_Function_leftBEOnNewline Type: boolean Default: false
BEStyle_Function_leftBEIndentSize Type: integer Default: 0
BEStyle_Function_rightBEOnNewline Type: boolean Default: true
BEStyle_Function_rightBEIndentSize Type: integer Default: 0
BEStyle_Function_FirstParamInNewline Type: boolean Default: false

Example format options:

NameValue
Parameters_StyleasStacked
Parameters_CommalfAfterComma
BEStyle_Function_leftBEOnNewlinefalse
BEStyle_Function_leftBEIndentSize0
BEStyle_Function_rightBEOnNewlinefalse
BEStyle_Function_rightBEIndentSize0
BEStyle_Function_FirstParamInNewlinefalse

Formatted SQL:

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 


Example format options:

NameValue
Parameters_StyleasStacked
Parameters_Comma

lfbeforeCommaWithSpace

BEStyle_Function_leftBEOnNewlinefalse
BEStyle_Function_leftBEIndentSize0
BEStyle_Function_rightBEOnNewlinefalse
BEStyle_Function_rightBEIndentSize0
BEStyle_Function_FirstParamInNewline

true

Formatted SQL:

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 


Example format options:

NameValue
Parameters_StyleasStacked
Parameters_CommalfAfterComma
BEStyle_Function_leftBEOnNewline

true

BEStyle_Function_leftBEIndentSize

2

BEStyle_Function_rightBEOnNewlinefalse
BEStyle_Function_rightBEIndentSize0
BEStyle_Function_FirstParamInNewlinefalse

Formatted SQL:

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 


Example format options:

NameValue
Parameters_Style

asWrapped

Parameters_CommalfAfterComma
BEStyle_Function_leftBEOnNewlinetrue
BEStyle_Function_leftBEIndentSize2
BEStyle_Function_rightBEOnNewlinefalse
BEStyle_Function_rightBEIndentSize0
BEStyle_Function_FirstParamInNewlinefalse

Formatted SQL:

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