为什么SQL Server函数isdate与cast同时使用报错?

create table student(birthday varchar(30));

insert into student values('-1');
insert into student values('2013-01-01');


--报错
select * from student where isdate(birthday)=1 and cast(birthday as datetime) = '2013-01-01';

--正确
select * from student where birthday='2013-01-01' and cast(birthday as datetime) = '2013-01-01';

这是为什么呢?

你可能感兴趣的:(为什么SQL Server函数isdate与cast同时使用报错?)