SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

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

DonAtWork
Flowing Fount of Yak Knowledge

2161 Posts

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

[Signature]For fast help, follow this link:
http://weblogs.sqlteam.com/brettk/archive/2005/05/25.aspx
Learn SQL
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

tkizer
Almighty SQL Goddess

USA
36582 Posts

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

quote:
Originally posted by tkizer

quote:
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
http://weblogs.sqlteam.com/tarad/



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
http://weblogs.sqlteam.com/JeffS




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

Tara Kizer
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

jsmith8858
Dr. Cross Join

USA
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
http://weblogs.sqlteam.com/JeffS
Go to Top of Page
Page: of 2 Previous Topic Topic Next Topic  
Previous Page
 New Topic  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.09 seconds. Powered By: Snitz Forums 2000