I know I’m the tool man (with Xtras.Net) but I can’t seem to find a T-SQL code formatter and wondered if anyone else knows about one?
I’m got someone inhouse who writes his SELECT, INSERT, and UPDATE statements in stored procs as if his monitor were infinitely wide, and only ever uses the tab or enter key if forced to do so. His SQL code has no whitespace, and his statements never line up; whenever I have to touch anything he does I have to spend 15 to 30 minutes reformatting his code. He also won’t comment his code telling me "I’m in development on it which is why I don’t format or comment; I’ll clean it up later when its finished" which of course never happens. I’m pretty much a standard’s zealot yet no matter what I do, I can’t get him to change. I feel like the pious Baptist minister whose teenage daughter drinks, smokes, listens to rock music, and is having sex with the entire football team!
We just had a big blow up for the nth time about it and his response to me was "Then adopt my style, I like it better, I can’t read your code when you format it." (If you want to see how I format T-SQL, you can read some of read my prior posts.) Jeesh I’m frustrated. Do any of you have to deal with this situation? Is it me? Any thoughts about how to get him to feel like there is value to working with standards everyone on a team can agree on?
Does anyone know of a T-SQL code formatting tool and standards management tool I can run on an entire SQL Server database?