Situation: I have several SSRS reports of which I need the sql-code to be documented. For this I need the code to be formatted in exactly the same way time and time again.
Problem: In some of my reports I have structures like
select outer
from (
select outin
from (
select inner
from (
select innerMax
from
)z
where
)x
where dateadd(d,12,getdate())
)y
where
And I want the result to be
select outer
from (
select outin
from (
select inner
from (
select innerMax
from
)z
where
)x
where dateadd(d,12,getdate())
)y
where
But I have problems with indenting the nested select's
I'd really appreciate it if you can provide me with examples. I've used splits, regex, substrings, ...
greetings