sql - Why subquery returns <= Error Occurs -
my sql query is
alter procedure [dbo].[proc_project_cat_d_list] @user_id bigint=null, @cat_id bigint=null, @dept_id bigint=null if(@cat_id > 0 ) begin select detail_id, detail_code, spec_1, spec_2, spec_3, spec_4, cat_id project_cat_details cat_id=@cat_id end else begin if(@dept_id null) select @dept_id=dept_id employee_master emp_id=@user_id create table #temp_dept ( dept_id bigint, dept_name varchar(100), parent_dept bigint ) insert #temp_dept ( dept_id, dept_name, parent_dept ) exec [dept_list] @dept_id, 1, @user_id select pcd.detail_id, pcd.detail_code,isnull(spec_1,'')+ ' ' +isnull(spec_2,'') specsfi, pcd.spec_1, pcd.spec_2, pcd.spec_3, pcd.spec_4, pcd.cat_id,p.project_name,pc.cat_name, p.project_id #temp_dept t, projects p, project_cat pc, project_cat_details pcd t.dept_id=p.dept_id , p.project_id=pc.project_id , pc.cat_id=pcd.cat_id , deleted !=1 order pcd.detail_id desc drop table #temp_dept end
i have added condition in sql query deleted!=0 error comes
based on comment, seems using version prior sql server 2005.
comparison operator !=
supports on sql server 2005 , above. try changing <>
operator.
Comments
Post a Comment