Refactors and formats SQL code.
I had a happy (Select * FROM) DBA that wrote me a 4000 line script. I useed SQL Refactor to clean up the script and it worked great... except for this :
I had a few sections like this:
IF EXISTS (SELECT * FROM dbo.Clients)
SELECT 1 AS TEST
SELECT 0 AS TEST
And when hitting the expand wildcard option, all the exists had the full columns listed. Now I know it doesn't change anything eprformance wise but I still see this as useless visual noise. I would be awesome if Refactor could recognize the exists and ignore the wildcard in the next parenthesis.
- Posts: 3
- Joined: Sun Sep 09, 2007 2:57 pm
Thanks for the feedback. I've raised this as a feature request and the developers will look into this when they work on a future version of the software. For your reference the feature request tracking code is: SR-824
- Posts: 157
- Joined: Thu Dec 28, 2006 12:21 pm
- Location: Red Gate
I have seen references that advise not using Select * in an exist clause. I believe the recommendation is to use "If exists (Select 1 from myTab where ..)" As I recall there is a slight but measurable performance gain.
- Posts: 23
- Joined: Wed Oct 29, 2008 3:30 pm
- Location: US - Tx
Return to SQL Refactor Previous Versions
Who is online
Users browsing this forum: No registered users and 1 guest