Red Gate forums :: View topic - Exists and Expand wildcards
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Refactor 1
SQL Refactor 1 forum

Exists and Expand wildcards

Search in SQL Refactor 1 forum
Post new topic   Reply to topic
Jump to:  
Author Message
netblazer



Joined: 09 Sep 2007
Posts: 3

PostPosted: Wed Sep 10, 2008 7:34 pm    Post subject: Exists and Expand wildcards Reply with quote

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)
BEGIN
SELECT 1 AS TEST
END
ELSE
BEGIN
SELECT 0 AS TEST
END

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.
Back to top
View user's profile Send private message
Ben Pinchen



Joined: 28 Dec 2006
Posts: 157
Location: Red Gate

PostPosted: Mon Sep 15, 2008 2:56 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
ray.herring@hotmail.com



Joined: 29 Oct 2008
Posts: 2
Location: US - Tx

PostPosted: Wed Oct 29, 2008 4:37 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group