--drop table #tmp
create table #tmp (id Int Identity(1,1) Primary key, name VarChar(250))
go
insert into #tmp(name) values(NEWID())
set statistics profile on
-- Execution plan create a Constant Scan
select * from #tmp
where id = 1 and id = 5
set statistics profile off
GO
select * from #tmp where id = 1 and id = 5 |--Constant Scan
--drop table tmp
create table tmp (id Int Identity(1,1) Primary key, name VarChar(250))
insert into tmp(name) values(NEWID())
-- Why execution plan does not create a Constant Scan for this case?
select * from tmp
Theme design by Jelle Druyts
Pick a theme: BlogXP sqlx BlogXP sqlx
Powered by: newtelligence dasBlog 2.0.7226.0
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.
© Copyright 2008, Conor Cunningham
E-mail