![]() Makes it easy to test new versions of sp’s and views because you can see exactly what changed. ![]() Click File, Compare Files, and it’ll show both files side by side with the differences highlighted. Use CVS to locally save the prior version of a stored proc, then open both the current and the prior in UE. UltraEdit also has a decent file compare utility. Saved me a ton of time at the new place – the prior “DBA” used Enterprise Manager’s graphical query builder to build all of his queries, and the. I never got ambitious enough to use this company-wide because people have wildly different syntax styles, but this really makes it easy to standardize and clean things up. Just make sure you save your file before you run the command, so you don’t lose your changes. UE has a variable for the filename and can set the working directory, so once you’ve ran the command line utility, you can run it again for other sql files pretty easily. Install the command line util, and then run it once from inside UltraEdit via Advanced, DOS Command. There’s a command line utility for download and you can even somewhat integrate it into UltraEdit. Automatic Code Cleanup From The Command Line Plus, that tool even facilitates inline SQL – in the “Output” dropdown at the top, pick the programming tool you’re using and it’ll build the string for you, nice and clean. Just standardize on a set of options, and then have everybody clean up their sp’s in here before they check them into CVS. I ran across this when trying to clean up some horrendous sql at the new gig. Copy/paste a small stored proc in there and it fixes the indenting, cases, and puts one item per line. Call it SQLtidy – or at least, they should have. Instead, check out this online SQL formatter. UltraEdit theoretically has the ability to re-indent code like HTMLtidy cleans up HTML, but UltraEdit’s method is woefully inadequate. Highlight the lines you want to comment out, and click Edit, Comment Add. I have to confess that I never use those, though. It has support for templates and code snippets built in. ![]() (This is defined in the wordfile.txt for each language.) When you start a “begin” statement and hit enter, for example, it automatically tabs in. It automatically indents and unindents based on the words you type. Tabs work differently across different editors (Query Analyzer, Enterprise Mgr, UltraEdit, Notepad, etc), but spaces work exactly the same. ![]() It can automatically use spaces instead of tabs, and you can set the number of spaces to use for each press of the tab button. When your cursor is on a beginning parenthesis, UltraEdit highlights the matching end one, regardless of which line it’s on. It automatically highlights the matching parenthesis. ![]() (Download the T-SQL word file off and append it to the end of the installed wordfile.txt to enable it.) It has color-coded syntax highlighting for just about any language imaginable via add-on word files. I had to open it and do some editing to remember what all they were. There’s so many advantages you just take for granted after a while. My former manager asked why I use UltraEdit for all of my SQL Server coding, and after pouring out the answer, I figured I should post it here as well for posterity. ![]()
0 Comments
Leave a Reply. |