Home All Groups Group Topic Archive Search About

Indentation of code in SQL server 2005



Author
28 Mar 2006 1:06 PM
pacman
I am new to SQL server 2005. If there are many nested if conditions, it
becomes difficult to map the begin and corresponding end tags of each block.
Is there any tool/tip by which I can trace which end corresponds to which
begin and vice versa.

something like this..
IF
... BEGIN
... <SOME CODE>
.....IF
.......BEGIN
.......<SOME CODE>
.......END
...END

Sometimes when I review code, I find it time consuming.
Anyone please help.

Author
28 Mar 2006 1:11 PM
Uri Dimant
Hi
Its hard to suggest but perhaps you need to looka at CASE expression as
well.




Show quoteHide quote
"pacman" <pac***@discussions.microsoft.com> wrote in message
news:B455A08C-844C-4F9C-ADF8-8BF7F8E61714@microsoft.com...
>I am new to SQL server 2005. If there are many nested if conditions, it
> becomes difficult to map the begin and corresponding end tags of each
> block.
> Is there any tool/tip by which I can trace which end corresponds to which
> begin and vice versa.
>
> something like this..
> IF
> .. BEGIN
> .. <SOME CODE>
> ....IF
> ......BEGIN
> ......<SOME CODE>
> ......END
> ..END
>
> Sometimes when I review code, I find it time consuming.
> Anyone please help.
>
Are all your drivers up to date? click for free checkup

Author
7 Apr 2006 7:17 AM
pacman
Hi Uri,

I am considering a scenario where if is unavoidable and i have several begin
end statements.

Perhaps SQL 2005 team need to put this feature in..

Show quoteHide quote
"Uri Dimant" wrote:

> Hi
> Its hard to suggest but perhaps you need to looka at CASE expression as
> well.
>
>
>
>
> "pacman" <pac***@discussions.microsoft.com> wrote in message
> news:B455A08C-844C-4F9C-ADF8-8BF7F8E61714@microsoft.com...
> >I am new to SQL server 2005. If there are many nested if conditions, it
> > becomes difficult to map the begin and corresponding end tags of each
> > block.
> > Is there any tool/tip by which I can trace which end corresponds to which
> > begin and vice versa.
> >
> > something like this..
> > IF
> > .. BEGIN
> > .. <SOME CODE>
> > ....IF
> > ......BEGIN
> > ......<SOME CODE>
> > ......END
> > ..END
> >
> > Sometimes when I review code, I find it time consuming.
> > Anyone please help.
> >
>
>
>
Author
7 Apr 2006 7:53 AM
Jan Van der Eecken
I agree that SQL Management Studio lacks the kind of support that Visual
Studio users have become accustomed to in this area. But then again, no-one
forces you to use Management Studio, so why don't you get yourself a decent
editor that parses SQL and does the proper indentation? We all know that
parsing SQL code is not easy, that's why there is no Intellisense built into
the product in the first place. But some support for this kind of request
would really be nice. MS are you listening?

Regards,
Jan



Show quoteHide quote
"pacman" <pac***@discussions.microsoft.com> wrote in message
news:D7D9296C-262D-4267-A29B-5C741272DBA4@microsoft.com...
> Hi Uri,
>
> I am considering a scenario where if is unavoidable and i have several
> begin
> end statements.
>
> Perhaps SQL 2005 team need to put this feature in..
>
> "Uri Dimant" wrote:
>
>> Hi
>> Its hard to suggest but perhaps you need to looka at CASE expression as
>> well.
>>
>>
>>
>>
>> "pacman" <pac***@discussions.microsoft.com> wrote in message
>> news:B455A08C-844C-4F9C-ADF8-8BF7F8E61714@microsoft.com...
>> >I am new to SQL server 2005. If there are many nested if conditions, it
>> > becomes difficult to map the begin and corresponding end tags of each
>> > block.
>> > Is there any tool/tip by which I can trace which end corresponds to
>> > which
>> > begin and vice versa.
>> >
>> > something like this..
>> > IF
>> > .. BEGIN
>> > .. <SOME CODE>
>> > ....IF
>> > ......BEGIN
>> > ......<SOME CODE>
>> > ......END
>> > ..END
>> >
>> > Sometimes when I review code, I find it time consuming.
>> > Anyone please help.
>> >
>>
>>
>>
Author
3 Jul 2009 4:59 AM
Jeff Doak
The tool I spoke of is available here for free (donations accepted):
http://www.softfrontiers.com/Downloads/ReIndenter.shtml

Enjoy!

From http://www.developmentnow.com/g/118_2009_5_0_0_725837/Indentation-of-code-in-SQL-server-2005.htm

Posted via DevelopmentNow.com Groups
http://www.developmentnow.com/g/

Bookmark and Share