Pages

Friday 24 April 2009

Minor Update and Feedback

New formatting option added and updates to the Web Services. I'm also opening up the flood gates to getting feedback. Email or post up options or functionality you would like added. I will publish a wish list, then work on adding all the easy bits of functionality. :-)

Formatting SQL is harder than you think..

I've had a couple of pieces of feedback about the T-SQL Tidy site. One is that the hosting is a bit slow and that the format of the SQL produced is not as good as the SQL generated from SQL Server.

The T-SQL generated by SQL Server when you right click on a table and choose 'Script table as' is much better than the format of the T-SQL after it has been parsed by the formatting engine.

This is true, I don't think it would be possible to format the T-SQL any better than the way SQL Server is doing it. This is because SQL Server understands what it is scripting, the definition of each object (table's and column's) are stored inside SQL Server. T-SQL Tidy has no knowledge of this, it reformats the SQL outside the context of the SQL Server.

I was trying to explain why the formatting engine behind this site is not as good as formatting by hand to a friend of mine. He asked why don't you just insert line breaks after commas? I explained that although an early version of the engine did just that, but its not that simple. Commas are used for separating parameters in internal functions and stored procedures, how do you know when a comma is separating fields or separating parameters in a function?

The answer is you cant. (Okay – you could, but not practical)

So I have added a new option to the site, “Insert New Lines after Commas” - so if you are formatting very simple T-SQL and you want new lines after each field, just enable this tick box.

The hosting is provided by ASPSpider.com, which is a free hosting site, as it is free I cant complain. It the speed becomes a big issue or it the site becomes too popular, it may need a new home but until then I am happy with ASPSpider.com.

Saturday 18 April 2009

Format SQL on your desktop.

Inbetween all the normal household chores I've writen the first of (hopefully) many utilites using the T-SQL Tidy web service. The binary and source code are aviable from here. I'm currently working on another utility, which will tidy all the stored procesdures in a database. It should be released in the next few weeks.


I am also working on producing an offline version, but there is no planned release date yet.

I thought I would just note that the domain name http://www.tsqltidy.info/ also links to http://aspspider.info/tsqlparser - It was only 99p!! I just cant resist a bargin. :-)

Tuesday 7 April 2009

Minor Updates.

I've added cross browser support for cutting and pasting - but there are still some issues with Chrome (details here).

I've updated the feed from blogger to show the first 200 characters of each post. (Source code coming soon)

Updated descriptions on web service methods.

Saturday 4 April 2009

Version 0.1 Released

I've finally put the T-SQL Tidy site live today. It feels like a very long time, but its only been a few weeks from conception to implementation.


As it's only on version 0.1, please feel free to leave feedback or suggestions for improvements.