Home Forums SQL Server 2008 SQL Server 2008 - General Another free T-SQL Formatter, open-source and SQL2K8-compatible, SSMS Add-In RE: Another free T-SQL Formatter, open-source and SQL2K8-compatible, SSMS Add-In

  • I like the tool a lot. I was looking for a tool to batch format sql scripts for the longest. I would like to drop some feedback after playing with it after couple of minutes.

    For #1 I wish the comma delimited list would fit the current line. For #2 I wish there was no newline after "CAST((" and no newline before ") AS VARCHAR(6))". For #3 a newline got lost. For #4 no newline for column list and after, no newline for options after with and no newline before the last comma

    #1

    CASE

    WHEN lt.[T_SLS_DEED_CAT_TYP] = 'X'

    THEN CASE

    WHEN lt.[T_SLS_DEED_CD] IN (

    'MG',

    'TR',

    'EQ',

    'AI',

    'AP',

    'CL',

    'DP',

    'RV',

    'IM',

    'SE',

    'TL',

    'MO'

    )

    THEN 'T'

    ELSE 'G'

    END

    ELSE lt.[T_SLS_DEED_CAT_TYP]

    END AS DeedCatTyp,

    #2

    CAST((

    SELECT OutVal

    FROM Util.dbo.RemoveLeadingZerosInline(lt.T_BUY_ADDR_APT_NBR)

    ) AS VARCHAR(6)) AS BuyAddrAptNbr,

    #3

    ) mtgcnt

    OPTION (RECOMPILE)

    --#endregion

    formatted to

    ) mtgcnt

    OPTION (RECOMPILE) --#endregion

    #4

    CREATE UNIQUE NONCLUSTERED INDEX [TransId] ON [DiabloStg-Diablo].[DataFolder-Trans_view] (

    [DataSupplierId] ASC,

    [TransId] ASC

    )

    WITH (

    DATA_COMPRESSION = ROW,

    SORT_IN_TEMPDB = ON

    )