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

Our new SQL Server Forums are live! Come on over! We've restricted the ability to create new threads on these forums.

SQL Server Forums
Profile | Active Topics | Members | Search | Forum FAQ
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 dynamic where clause and null values
 Reply to Topic
 Printer Friendly
Previous Page
Author Previous Topic Topic Next Topic
Page: of 2

Flowing Fount of Yak Knowledge

2167 Posts

Posted - 04/17/2007 :  11:24:51  Show Profile  Reply with Quote
I bet
fixes it!

[Signature]For fast help, follow this link:
Learn SQL
Go to Top of Page

Almighty SQL Goddess

38200 Posts

Posted - 04/17/2007 :  11:46:04  Show Profile  Visit tkizer's Homepage  Reply with Quote
Originally posted by jsmith8858

Originally posted by tkizer

Originally posted by dinakar

Theoretically it should be better since using functions on column names especially in WHERE clauses can force table scans..

I don't believe that's the case in his situation since the column is isolated on one side of the predicate:

WHERE ColumnName = SomeFunction(...)

Perhaps this is what you are referring to:

WHERE SomeFunction(ColumnName, ...) = SomeValue

Tara Kizer

Actually, that is not correct, the column is not isolated on one side ...
The column is referenced on BOTH sides.

This is actually the situation:

WHERE ColumnName = SomeFunction(... ColumnName ... )

- Jeff

But the point I was trying to make is about the table scan.

Tara Kizer
Go to Top of Page

Dr. Cross Join

7423 Posts

Posted - 04/17/2007 :  12:14:42  Show Profile  Visit jsmith8858's Homepage  Reply with Quote
Tara -- I was simply responding to your statement about the column being isolated on one side; yes, on one side it is indeed isolated, but it is also referenced AGAIN on the other side (in the COALESCE() function) ... therefore, it will incur a scan.

- Jeff
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000