ISO pretty-printer/formatting program for SQL code

Nicholas Carey (B.E.S.T.) <>
Wed, 22 Nov 1995 03:17:48 GMT

          From comp.compilers

Related articles
ISO pretty-printer/formatting program for SQL code (Nicholas Carey (B.E.S.T.)) (1995-11-22)
| List of all articles for this month |

Newsgroups: comp.compilers
From: Nicholas Carey (B.E.S.T.) <>
Keywords: SQL, question
Organization: Compilers Central
Date: Wed, 22 Nov 1995 03:17:48 GMT

When stored procedures are entered/compiled using the Microsoft SQL
Server v4.21 client ISQL/W, leading whitespace is stripped from the
source code. A rather bad habit, IMHO.

I've got two systems to maintain -- both loaded with stored procedures
that have been munged this way. I'm putting the source code for the
database into a source code control system. Since I don't trust the
original sources (since I have no way of knowing what has been altered
in the database on the fly), I'm generating a script for each object
to be placed into the source code control system.

Source code with all the indentation/whitespace removed is pretty ugly
and hard to read. And I hate reformatting it manually. Consequently,
I'm looking for a formatter/pretty-printer program for TRANSACT-SQL.
Preferably one that allows user-specified formatting styles.

I've searched the WWWeb and all the software archives that I know of,
but to no avail. Such a critter doesn't seem to exist. Before I go to
the trouble of writing one....

Has anybody written such a program? If you have, would you be willing
to share?

Thanks in advance.


Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.