|
khalik
Constraint Violating Yak Guru
443 Posts |
Posted - 2002-02-05 : 22:07:07
|
| i have a procedure which takes @act as in parameter...@act can be null if null entire setif not null details of a one account..select cast(a.account_id as numeric),c.M1_FULL_USAGE_QTY, a.plan1, c.M1_RATE_RANK ,b1.Free_Min,b1.Direct_Connect, b1.Phone_Connect,b1.Rate,a.plan2, b2.Free_Min, b2.Direct_Connect, b2.Phone_Connect , b2.Rate from Rateplan_Analysis c,(select owner_id,account_id,substring(rate_scheme ,1,(charindex(',',rate_scheme )-1)) plan1,ltrim(substring(rate_scheme ,(charindex(',',rate_scheme)+1),len(rate_scheme)-charindex(',',rate_scheme) )) plan2from (select owner_id,account_id, rate_scheme =case when sum(M1_FULL_USAGE_QTY) <161 then 'Grid 28 , Saver' when sum(M1_FULL_USAGE_QTY) >160 and sum(M1_FULL_USAGE_QTY) <551 then 'Saver , Quality' when sum(M1_FULL_USAGE_QTY) >550 and sum(M1_FULL_USAGE_QTY) <1101 then 'Quality , Premium' when sum(M1_FULL_USAGE_QTY) >1100 then 'Premium , X' end from Rateplan_Analysis where owner_id= isnull(@act,owner_id) group by account_id,owner_id )t) a, (select a.id,Rate_Plan,Direct_Connect,Phone_Connect,Free_Min,Rank,Rate from Plan_Master a, Plan_det b where a.id*=b.id) b1, (select a.id,Rate_Plan,Direct_Connect,Phone_Connect,Free_Min,Rank,Rate from Plan_Master a, Plan_det b where a.id*=b.id) b2 where a.account_id=c.account_id and b1.Rate_Plan=plan1 and b2.Rate_Plan=plan2 and b1.Rank=c.M1_RATE_RANK and c.M1_RATE_RANK=b2.rank order by cast(a.account_id as numeric), c.M1_RATE_RANK if i execute the query alone it works fine....if i run the procedure....i get a error..ODBC: Msg 0, Level 19, State 1SqlDumpExceptionHandler: Process 8 generated fatal exception c0000005 EXCEPTION_ACCESS_VIOLATION. SQL Server is terminating this process. what can be the possible thing gone wrong.======================================Ask to your self before u ask someone |
|