• If you simply want to know about existence, you probably want to look at using something like an EXISTS clause, possibly combining it with a TOP 1 clause.

    Count(*) is an awful lot of work, just to check for existence.

    If you could give us some data specifics (what the tables look like, what you're trying to check for), we can try to give you some code examples that apply to your case.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?