Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Performance

Author  Topic 

gsnk
Starting Member

24 Posts

Posted - 2005-08-01 : 15:17:44
I recently had an argument with another developer because of a habit of mine where I construct my conditionals like this:

WHERE 1=1
AND <condition>
AND <another condition>

This habit stems from writing too many dynamic queries in my previous life. I would argue that this "empty" condition will be eliminated by the optimizer and, thus, not cause even an additional nano-flop of computing power.

Please let me know what you think!

Thanks.

Alex

---------------------------

**It's better to light a candle than to curse the darkness.**

spirit1
Cybernetic Yak Master

11752 Posts

Posted - 2005-08-01 : 15:20:28
ok maybe a nanoflop but no more...
so why don't you stop writing it? it's not that hard...

Go with the flow & have fun! Else fight the flow
Go to Top of Page
   

- Advertisement -