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)
 Query plan in SQL2005 vs SQL2000

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2006-07-11 : 11:23:05
Tim writes "Below code runs fine in SQL2000 but not SQL2005. Can someone explain this? Thanks


create table Test2005 (
CatID int,
ValueID int,
ValueText varchar(50) )

insert into Test2005 values (1, 1, null)
insert into Test2005 values (1, 1, '0.1000')
insert into Test2005 values (1, 1, '0.1500')
insert into Test2005 values (1, 1, '11')
insert into Test2005 values (1, 1, '4')
insert into Test2005 values (1, 2, 'Jul 23 2004 12:00AM')
insert into Test2005 values (1, 3, 'Jul 24 2004 12:00AM')
insert into Test2005 values (1, 4, 'Jul 26 2004 12:00AM')
insert into Test2005 values (1, 1, 'N')
insert into Test2005 values (1, 1, 'y')


Select * from Test2005
WHERE 1 = 1
AND ValueID in (2,3,4)
And CatID in (1)
AND ValueText BETWEEN (Convert(Datetime,'5/27/2005') - 365 - 30 )
AND (Convert(Datetime,'5/27/2005') - 120 )"
   

- Advertisement -