看下这个存储过程哪儿有问题
Employee(Emp_id char(8),Emp_name varchar(20),Depart char(2))Department(Depart char(2),ManagerID char(8))
主键外键都已定义
select Emp_name from Employee where Emp_id in (select ManagerID from Department where Depart in (select Depart from Employee where Emp_id = '00000000'))
可以正确执行并得出结果
然而用存储过程却不行
该存储过程如下
create procedure managerQuery (@id char)
as
select Emp_name from Employee where Emp_id in (select ManagerID from Department where Depart in (select Depart from Employee where Emp_id = @id))
go
然后调用
declare @temp char set @temp = '00000000'
execute managerQuery @temp
结果是空集,也没有报错,怎么回事?