SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
[13.0.56 Pro] - Formatting issues

 
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant View previous topic
View next topic
[13.0.56 Pro] - Formatting issues
Author Message
gemisigo



Joined: 11 Mar 2010
Posts: 2165

Post [13.0.56 Pro] - Formatting issues Reply with quote
I have a short piece of code:
Code:

CREATE INDEX [ix_forg_tetel_250415_1614] ON [EN_DATA].[dbo].[Forg_tetel] ([Datum] ASC, [FeladatTipusId] ASC, [Jarat] ASC, [DiszpState] ASC) INCLUDE ([DesignedState], [Erkezes], [ErkLS], [FeladatId], [Gepkocsi], [GkVez], [IndLS], [IranyitoHely], [IrIndLS], [JaratDatum], [JaratErkezes], [JaratErkLS], [JaratIndLS], [JaratSzam], [masodresz_jarat]);


and two formatting rules for CREATE INDEX statements, and neither works as expected. The one in my T-SQL Compress ruleset is this:
Code:

CREATE ... INDEX ...
    ON ... (..., ...)
    INCLUDE (..., ...);


When applied to the code above, I'd expect the result to be:
Code:

CREATE INDEX [ix_forg_tetel_250415_1614]
   ON [EN_DATA].[dbo].[Forg_tetel] ([Datum] ASC, [FeladatTipusId] ASC, [Jarat] ASC, [DiszpState] ASC)
   INCLUDE ([DesignedState], [Erkezes], [ErkLS], [FeladatId], [Gepkocsi], [GkVez], [IndLS], [IranyitoHely], [IrIndLS], [JaratDatum], [JaratErkezes], [JaratErkLS], [JaratIndLS], [JaratSzam], [masodresz_jarat]);


Instead, I get this:
Code:


CREATE INDEX [ix_forg_tetel_250415_1614]
    ON [EN_DATA].[dbo].[Forg_tetel] ([Datum] ASC, [FeladatTipusId] ASC, [Jarat] ASC, [DiszpState] ASC)
    INCLUDE (
    [DesignedState]
    ,[Erkezes]
    ,[ErkLS]
    ,[FeladatId]
    ,[Gepkocsi]
    ,[GkVez]
    ,[IndLS]
    ,[IranyitoHely]
    ,[IrIndLS]
    ,[JaratDatum]
    ,[JaratErkezes]
    ,[JaratErkLS]
    ,[JaratIndLS]
    ,[JaratSzam]
    ,[masodresz_jarat]
);


I guess this must be because my Line Length for DDL Code Wrapping was set to something that the INCLUDE line would go beyond (when I increased it to 280, it no longer broke it into one-line-per-column). But even in that case I'd expect it to try and populate the line like this:
Code:

CREATE INDEX [ix_forg_tetel_250415_1614]
    ON [EN_DATA].[dbo].[Forg_tetel] ([Datum] ASC, [FeladatTipusId] ASC, [Jarat] ASC, [DiszpState] ASC)
    INCLUDE ([DesignedState], [Erkezes], [ErkLS], [FeladatId], [Gepkocsi], [GkVez], [IndLS], [IranyitoHely], [IrIndLS],
    [JaratDatum], [JaratErkezes], [JaratErkLS], [JaratIndLS], [JaratSzam], [masodresz_jarat]);


or something similar.

The other rule is this:
Code:

CREATE ... INDEX ...
    ON ... ( ...
       ,...)
    INCLUDE ( ...
             ,...)
    WHERE ...
        AND ...;


Applying this one has catastrophic consequences. The resulting code is ruined:
Code:


CREATE INDEX [ix_forg_tetel_250415_1614]
    ON [EN_DATA].[dbo].[Forg_tetel] ( [Datum] ASC
(        ,[FeladatTipusId] ASC
(        ,[Jarat] ASC
(        ,[DiszpState] ASC)
    INCLUDE ( [DesignedState]
             ,[Erkezes]
             ,[ErkLS]
             ,[FeladatId]
             ,[Gepkocsi]
             ,[GkVez]
             ,[IndLS]
             ,[IranyitoHely]
             ,[IrIndLS]
             ,[JaratDatum]
             ,[JaratErkezes]
             ,[JaratErkLS]
             ,[JaratIndLS]
             ,[JaratSzam]
             ,[masodresz_jarat]);

It inserts unwanted opening parentheses into the code.
Tue Apr 15, 2025 10:44 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » SQL Assistant All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.