Page 2 of 2 FirstFirst 12
Results 16 to 24 of 24

Thread: Free Online SQL Formatter

  1. #16
    Join Date
    Jun 2005
    Posts
    24
    Try new version here:
    http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm

    and there are also add-ins for SQL Server Management Studio and Visual Studio 2005.

  2. #17
    Join Date
    Jun 2005
    Posts
    24
    New version is available, better support for SQL Server 2005

    http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm

  3. #18
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Doesnt work for SQl Server 2005 syntax

    CREATE TABLE AppUser
    (
    UserID int NOT NULL identity(1,1) ,
    FirstName varchar(100) NOT NULL ,
    MiddleInitial char(3) NULL ,
    LastName varchar(100) NULL ,
    LoginName varchar(100) NULL ,
    UserDescription varchar(100) NULL ,
    Password varchar(100) NULL ,
    CustomerID int NULL ,
    CreatedDt datetime constraint def_date_19 default getdate(),
    PRIMARY KEY CLUSTERED (UserID ASC)
    )



    result:

    /* Powered by General SQL Parser (www.sqlparser.com) */

    ASC(12,36) expected token ,

  4. #19
    Join Date
    Jun 2005
    Posts
    24
    Thank you mak, we have fixed this bug in ver2.7.6

  5. #20
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    i believe you needed more testing for sql server 2005. Doesnt work for following code.

    WITH DUPLICATE(ROW,GROUPROW,ID,FNAME,LNAME)
    AS
    (
    SELECT ROW,GROUPROW= CASE WHEN ID=ID
    THEN
    (SELECT COUNT(*) FROM (SELECT ROW_NUMBER() OVER (ORDER BY ID) AS ROW,
    ID,LNAME,FNAME FROM MYTABLE
    ) AS A WHERE A.ID=B.ID AND
    A.ROW<B.ROW)+1 END,ID,FNAME,LNAME FROM (SELECT ROW_NUMBER() OVER (ORDER
    BY ID) AS ROW,
    ID,LNAME,FNAME FROM MYTABLE
    )AS B
    )
    DELETE FROM DUPLICATE WHERE GROUPROW<>1

    result:
    /* Powered by General SQL Parser (www.sqlparser.com) */

    DELETE(14,1) expected token , SELECT



    use master
    go
    Create Database MyDB_Snapshot1 on
    (Name ='Mydb_Data',
    FileName= 'C:\data\MyDB_Data.SS1')
    AS SNAPSHOT of MyDB;
    go

    result:

    /* Powered by General SQL Parser (www.sqlparser.com) */

    Database(3,8) expected token:UNIQUE FUNCTION TRIGGER TABLE INDEX BITMAP GLOBAL LOCAL TEMPORARY VIEW PROCEDURE Name(4,2) expected token SELECT

  6. #21
    Join Date
    Jun 2005
    Posts
    24
    Thank you.
    sql server 2005 introduce more new syntax, I think we need more testing to have a better support

  7. #22
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Good Luck and let us know when you are in good shape.

  8. #23
    Join Date
    Jun 2005
    Posts
    24

    New version 2.8.1 available

    Hi all,
    I have just setup the new version.
    This new version support html output without change original
    sql layout, or just modify case only. so it's very convenience if
    you like to post your sql code to blogs/forums/wiki with colorful sql code which is more easy to read.

    have a try of this free online sql formatter now!

    http://www.wangz.net/gsqlparser/sqlpp/sqlformat.htm

    --James

  9. #24
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    Looks very good. Still have diffculty in creating SQL Server 2005 syntax. eg:

    use master
    go
    Create Database MyDB_Snapshot1 on
    (Name ='Mydb_Data',
    FileName= 'C:\data\MyDB_Data.SS1')
    AS SNAPSHOT of MyDB;
    go

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •