Today I came across some tools which does smart way of formatting your SQL code.Who does’nt like a code which is well formatted and easy to read.
I remember my college days when I used to write multiple lines of code for my final semester project and manually format the code for printing and ease of understanding purpose.
I would have scored better grades if I had thought about this tool long back!!! There are many tools out there,however the one which I liked well is –
http://www.dpriver.com/pp/sqlformat.htm?ref=wangz.sqlformat.htm
You can get beautiful and well formatted codes like
BEGIN TRAN
DECLARE @endDate DATETIME
SET @endDate = Dateadd(hh, 1, Getdate()) — 1 hours from now
WHILE Getdate() < @endDate
BEGIN
INSERT INTO [Test]
VALUES (1)
WAITFOR delay ’00:00:02′;
END
Hope you all liked this tool and happy coding!
<Update Added 12/10/2012
Today I found another tool which is pretty impressive,its http://sqlformat.appspot.com/
<Update>