|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Indentation of code in SQL server 2005
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. 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. > 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. > > > > > 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. >> > >> >> >> 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/
Other interesting topics
SQL Server 2005: Migrate DTS to Where?
timeout trouble in SQL Server 2005 (reposted) urgent: remove login problem Grant Read only access to ALL databases fields contain carriage returns in csv export SQL Database Backup on Network drive gives error Remove Role and apply permissions to Domain Group System Proces issues "RESOURCE MONITOR" command and blocks a proce Rebuild SQL 2000 indexes on-line changing servers dynamically via TSQL |
|||||||||||||||||||||||