August 2, 2018 at 10:02 am
Hi,
I found one formatter online, but wanted to know if you use any tools to format the T-SQL code , before releasing it.
Thanks
August 2, 2018 at 10:06 am
I use the Poor SQL SSMS plugin. Works pretty well, and keeps things consistent. I'm not in love with all it's formatting decisions, but consistency is best.
August 2, 2018 at 10:09 am
sqlguy80 - Thursday, August 2, 2018 10:02 AMHi,I found one formatter online, but wanted to know if you use any tools to format the T-SQL code , before releasing it.
Thanks
I've tried ApexSQL. They have a free SQL code formatter that's an addin to SSMS.
It's pretty good, you can customise the output to get nearly any formatting you desire. https://www.apexsql.com/sql_tools_refactor.aspx
August 2, 2018 at 1:18 pm
I have used PoorSQL on the web and have installed ApexSQL Refactor. They both do a decent job for free tools. You could also try SSMS Tools Pack.
I'm currently using RedGate Prompt and it has lots of features.
I suggest that you try each of them and compare them to find what you prefer.
I personally believe that format shouldn't be left to tools and it should be something that comes from the developers in the first place (using team standards).
August 2, 2018 at 2:48 pm
I'd rather not be pasting T-SQL code to the web just to format it. RedGate's 'SQL Prompt', a plugin for SSMS, has a Format SQL option that works well.
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
August 2, 2018 at 3:47 pm
Free versions already mentioned.
For paid versions
RedGate - SQL Prompt
DevArt - SQL Complete
Neither completely good, one better on particular things, the other better on other things. DevArt a lot cheaper than RedGate.
August 2, 2018 at 4:39 pm
Eric M Russell - Thursday, August 2, 2018 2:48 PMI'd rather not be pasting T-SQL code to the web just to format it. RedGate's 'SQL Prompt', a plugin for SSMS, has a Format SQL option that works well.
You don't need to paste T-SQL code on the web. Poor SQL has an SSMS plug-in that works offline.
August 3, 2018 at 3:04 am
sqlguy80 - Thursday, August 2, 2018 10:02 AMHi,I found one formatter online, but wanted to know if you use any tools to format the T-SQL code , before releasing it.
Thanks
My suggestion is to write the code in the proper format in the first place.
😎
If the code is properly formatted, there errors are less likely as it is more readable, if aligned for columnar editing, then that's a big bonus as it makes each snippet more reusable.
It may take slightly more time to write the code but it can safe hours of work.
August 3, 2018 at 3:42 am
Eirikur Eiriksson - Friday, August 3, 2018 3:04 AMsqlguy80 - Thursday, August 2, 2018 10:02 AMHi,I found one formatter online, but wanted to know if you use any tools to format the T-SQL code , before releasing it.
ThanksMy suggestion is to write the code in the proper format in the first place.
😎If the code is properly formatted, there errors are less likely as it is more readable, if aligned for columnar editing, then that's a big bonus as it makes each snippet more reusable.
It may take slightly more time to write the code but it can safe hours of work.
I often have to edit someone else's SQL that's almost unreadable due to its formatting (or non-formatting) a formatting tool takes away many minutes of manual effort and over a year many hours.
August 3, 2018 at 4:25 am
I do love me some SQL Prompt from Redgate Software. It does more than just format the code. It also provides type-ahead, supports Azure SQL Database and Managed Instances, has code analysis, snippets, more. It's a very complete method for programming T-SQL, not just a formatter.
I loved it even before I went to work for them. Yes, I work for them.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
August 3, 2018 at 7:12 am
August 3, 2018 at 8:25 am
Eirikur Eiriksson - Friday, August 3, 2018 3:04 AMsqlguy80 - Thursday, August 2, 2018 10:02 AMHi,I found one formatter online, but wanted to know if you use any tools to format the T-SQL code , before releasing it.
ThanksMy suggestion is to write the code in the proper format in the first place.
😎If the code is properly formatted, there errors are less likely as it is more readable, if aligned for columnar editing, then that's a big bonus as it makes each snippet more reusable.
It may take slightly more time to write the code but it can safe hours of work.
Even better, you can enforce your T-SQL formatting standard using SQL Server's policy-based management. Don't even let the developer save their procedures and views until they're properly formatted. :Whistling:
"Do not seek to follow in the footsteps of the wise. Instead, seek what they sought." - Matsuo Basho
August 3, 2018 at 8:34 am
Eric M Russell - Friday, August 3, 2018 8:25 AMEven better, you can enforce your T-SQL formatting standard using SQL Server's policy-based management. Don't even let the developer save their procedures and views until they're properly formatted. :Whistling:
Got examples of this? Would be interested as not aware it was possible.
August 3, 2018 at 12:46 pm
I really like Redgate SQL Prompt. With some of the horrendous T-SQL code I inherit, it makes my life a lot easier. Sometimes I just reformat a section of code but a lot of times on the really bad stuff, I just reformat the whole deal.
August 3, 2018 at 4:19 pm
I use Red-Gate SQL Prompt. It has some nice enhanced Intellisence like functionality I really like. It collects Meta data when you connect to a linked server. It fills in column lists and a lot of other functionality as well as formatting.
Viewing 15 posts - 1 through 15 (of 47 total)
You must be logged in to reply to this topic. Login to reply