General SQL Parser and SQL Pretty Printer Formatter options

Index

Available format options for indentation:

gFmtOpt.IndentLen Type: Integer Default: 2
gFmtOpt.UseTab Type: Boolean Default: false
gFmtOpt.TabSize Type: Integer Default: 2
gFmtOpt.BEStyle_Function_BodyIndent Type: Integer Default: 2
gFmtOpt.BEStyle_Block_leftBEOnNewline Type: Boolean Default: true
gFmtOpt.BEStyle_Block_leftBEIndentSize Type: integer Default: 2
gFmtOpt.BEStyle_Block_rightBEIndentSize Type: integer Default: 2
gFmtOpt.BEStyle_BlockIndentSize Type: integer Default: 2
gFmtOpt.gFmtOpt.BEStyle_IfElseSingleStmtIndentSize Type: integer Default: 2

Example format options:

NameValue
gFmtOpt.BEStyle_Function_BodyIndent3

Formatted SQL:

CREATE PROCEDURE humanresources.Uspgetallemployees 
AS 
   SELECT lastname,
          firstname,
          jobtitle,
          department 
   FROM   humanresources.vemployeedepartment; 


Example format options:

NameValue
gFmtOpt.BEStyle_Block_leftBEIndentSize0
gFmtOpt.BEStyle_BlockIndentSize2

Formatted SQL:

CREATE PROCEDURE humanresources.Uspgetallemployees 
AS 
BEGIN 
  SELECT lastname,
         firstname,
         jobtitle,
         department 
  FROM   humanresources.vemployeedepartment; 
END 


Example format options:

NameValue
gFmtOpt.BEStyle_Block_leftBEOnNewlineefalse
gFmtOpt.BEStyle_Block_rightBEIndentSize0
gFmtOpt.BEStyle_BlockIndentSize2
gFmtOpt.BEStyle_IfElseSingleStmtIndentSize4

Formatted SQL:

IF @cost <= @compareprice BEGIN 
  PRINT 'These products can be purchased for less than ' 
END 
ELSE 
    PRINT 'The prices for all products in this category exceed ' 


Example format options:

NameValue
gFmtOpt.BEStyle_Block_leftBEOnNewlineefalse
gFmtOpt.BEStyle_Block_rightBEIndentSize

2

gFmtOpt.BEStyle_BlockIndentSize

0

gFmtOpt.BEStyle_IfElseSingleStmtIndentSize

2

Formatted SQL:

IF @cost <= @compareprice BEGIN 
  PRINT 'These products can be purchased for less than ' 
  END 
ELSE 
  PRINT 'The prices for all products in this category exceed ' 


Example format options:

NameValue
gFmtOpt.BEStyle_Block_leftBEOnNewlinee

true

gFmtOpt.BEStyle_Block_leftBEIndentSize

0

gFmtOpt.BEStyle_BlockIndentSize

2

gFmtOpt.BEStyle_IfElseSingleStmtIndentSize

2

Formatted SQL:

IF @cost <= @compareprice 
BEGIN 
  PRINT 'These products can be purchased for less than ' 
END 
ELSE 
  PRINT 'The prices for all products in this category exceed ' 


Example format options:

NameValue
gFmtOpt.BEStyle_Block_leftBEOnNewlinee

true

gFmtOpt.BEStyle_Block_leftBEIndentSize

2

gFmtOpt.BEStyle_BlockIndentSize

2

gFmtOpt.BEStyle_IfElseSingleStmtIndentSize

2

Formatted SQL:

IF @cost <= @compareprice 
  BEGIN 
    PRINT 'These products can be purchased for less than ' 
  END 
ELSE 
  PRINT 'The prices for all products in this category exceed '