mehdad.koulab
دوشنبه 29 شهریور 1389, 11:30 صبح
سلام دوستان
من ميخوام از يه جدول فيلد ID رو بنا به شرطي بردارم و بيارم تو يه جدول ديگه با فيلدي كه ارتباط داره مقايسه كنم و مقدار يه فيلد ديگم رو بخونم و بذارم تو VB.net حالا وقتي ميخونم ايراد ميگيره كه بيش از يك مقدار ID به دست آمده ببينين جلوي شرط اولي مساوي هم ميذارم باز همين خطا رو ميده
ALTERprocedure [dbo].[SPT_TBLCDData];8
@program_type nvarchar
as
begintransaction
select Programname from TBL_CDdata
where F_IDPtype like(select ID from TBL_ProgramType
where Program_type like'%'+ @program_type +'%')
if@@ERROR=0
begin
commit
end
else
begin
rollback
end
اينم خطايي كه ميده
Msg 512, Level 16, State 1, Procedure SPT_TBLCDData, Line 6
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.
من ميخوام از يه جدول فيلد ID رو بنا به شرطي بردارم و بيارم تو يه جدول ديگه با فيلدي كه ارتباط داره مقايسه كنم و مقدار يه فيلد ديگم رو بخونم و بذارم تو VB.net حالا وقتي ميخونم ايراد ميگيره كه بيش از يك مقدار ID به دست آمده ببينين جلوي شرط اولي مساوي هم ميذارم باز همين خطا رو ميده
ALTERprocedure [dbo].[SPT_TBLCDData];8
@program_type nvarchar
as
begintransaction
select Programname from TBL_CDdata
where F_IDPtype like(select ID from TBL_ProgramType
where Program_type like'%'+ @program_type +'%')
if@@ERROR=0
begin
commit
end
else
begin
rollback
end
اينم خطايي كه ميده
Msg 512, Level 16, State 1, Procedure SPT_TBLCDData, Line 6
Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, <, <= , >, >= or when the subquery is used as an expression.