Hi !

The following code is formatted like this
[code]
    co2.COMPONENT_ID
,    co2.COMPONENT_TYPE
, CASE     WHEN co2.COMPONENT_TYPE <> 21 THEN NULL ELSE co2.PARENT_ID END AS PARENT_ID
FROM
    SENTOSA.COMPONENT_HIERARCHY AS ch
CROSS APPLY dbo.ListAncestors(ch.NodePath_COMPONENT_ID) AS A
INNER JOIN
    SENTOSA.COMPONENT_HIERARCHY AS co2
ON
    A.node = co2.NodePath_COMPONENT_ID;
[/code]

The case is not aligned and a there is a tab after the the CASE which makes no sense !

Thanks for fixing this!

Torsten
MVP


torsten.strauss
0

Comments

4 comments

  • Russell D
    Hi Torsten, thanks for reporting this we'll look into it.
    Russell D
    0
  • Russell D
    Can you provide the full script and which version you're on please?
    Russell D
    0
  • torsten.strauss
    Hi Russell,

    SELECT
        co2.COMPONENT_ID
    , co2.COMPONENT_TYPE
    , CASE WHEN co2.COMPONENT_TYPE <> 21 THEN NULL ELSE co2.PARENT_ID END AS PARENT_ID
    FROM
        SENTOSA.COMPONENT_HIERARCHY AS ch
    CROSS APPLY dbo.ListAncestors(ch.NodePath_COMPONENT_ID) AS A
    INNER JOIN
        SENTOSA.COMPONENT_HIERARCHY AS co2
    ON
        A.node = co2.NodePath_COMPONENT_ID;

    Version is 9.2.8.6358
    Style is attached...

    Thanks!


    torsten.strauss
    0
  • way0utwest
    Under teh CASE section, you have the "collapse" checkbox set to 80. This is less than 80 characters, so it's one line, which I assume you want. When I copy/paste this, I get the alignment correctly with your style

    could there be some strange characters added in your query? If you copy paste in notepad and then paste back?

    way0utwest
    0

Add comment

Please sign in to leave a comment.