I get the following error on executing the proc.

Error Number 11055, severity(16), state(2). Query contains an illegal outer-join request.

I tried commenting out the outer-join causing the problem and the proc runs fine. But I am unsure if the data is correct.

Any ideas on how to work around this problem?

Thanks in advance!

This is the piece of query that is causing the problem.

/* Batch 4 Returned */
/* Pending Blotters */
select BSCode = b.bscode,
Pending = (b.quantity - makes),
Symbol = b.symbol,
Strt = b.strategy,
D_S = b.quantity_type,
MF_Rel = b.mf_relation,
MF_Targ = b.mf_target,
SettleDate = be.settle_date,
Mods = (select count(x.blotter_id)
from tms..blotter_mod x),
/*where x.blotter_id =* b.blotter_id),*/ /*illegal outer join*/
Lots = b.lots,
B_Sta = s.description,
O_Stat = o.status,
Tax = b.tax,
ClosingPrice = isnull(sec.sec_clsprice, 0),
E_Sta = be.status,
CreatedOn = b.created_date
from tms..tms_blotter_table b,
tms..blotter_status s,
tms..tms_blotter_extensions_table be,
spsrdb..sec_table sec,
tms..order_main o
where b.acc_nr = @acc_nr
and b.order_id *= o.order_id
and b.status = s.status
and b.blotter_id *= be.blotter_id
and (b.quantity - b.makes) != 0
and b.adpcusip = sec.sec_adpcusip
order by b.created_date desc