thanks for your response bro, i tried it works thanks , just make a little bit faster here which will increase the IO opeartion also
SELECT a.Eid, b.cDocNo
FROM @a a
LEFT OUTER JOIN @b-2 b
ON A.Eid = b.cid AND
a.DocNo = b.CDocNo
WHERE EXISTS (SELECT 1 FROM @b-2 c WHERE c.Cid = a.Eid )
ORDER BY
a.Eid
it increases the scan count of the second table 2 and double the logical reads, any other solution bro
Every rule in a world of bits and bytes, can be bend or eventually be broken
MyBlog About Common dialog control
A Visualizer for viewing SqlCommand object script [/url]