• First this clause of your statement:

    select s.sno from t,s where s.sid=t.sid and t.sno is null

    will return more than a single value, this then yieds the error

    Msg 512, Level 16, State 1, Line 1

    Subquery returned more than 1 value. This is not permitted when the subquery follows =, !=, = or when the subquery is used as an expression.

    The statement has been terminated.

    If everything seems to be going well, you have obviously overlooked something.

    Ron

    Please help us, help you -before posting a question please read[/url]
    Before posting a performance problem please read[/url]