2011-10-14 2 views
0

바인딩 할 수 없습니다다중 부분 식별자 "ocl.id_Project는"이것은 내 저장 프로 시저입니다

ALTER procedure [dbo].[GetProjectDetails] 
@id_Project varchar(50), 
@Flag varchar(50) 
as 

set nocount on; 

if @Flag='0' 
begin 
--distinct 
select oci.id_Project, cm.Project_Name, 
    (select Project_Name from tp_Project_Master mc where mc.id_Project=oci.id_Project) as Project_Name, oci.Thumbnail_Image 
    from tp_Project_Master cm, tp_Project_images oci 
    where cm.id_Project=ocl.id_Project and oci.syncoperation<>'D' and oci.isdefault=1 order by oci.dateadded desc 
end 

하지만이 오류를 얻고 것이 :

Msg 4104, Level 16, State 1, Procedure GetProjectDetails, Line 13 
The multi-part identifier "ocl.id_Project" could not be bound. 

내가 해결할 수없는 왜이 오류가 발생하는지.

답변

1

ocl (where 절에 ocl이 언급 됨)이라는 객체가 없습니다. oci이라는 개체가 있습니다. 나는 그저 오타를 추측하고있다.

1

이 아니라 테이블을 참조하기 위해 oci을 사용하고 있습니다. 이 줄을 변경하면 제대로 작동합니다.

where cm.id_Project=oci.id_Project 
관련 문제