Problem in query while executing through stored procedure

  • Hi all :-),

    I have the below query in a stored procedure. When I am executing the stored procedure it is showing zero (0) results. If I run it from backend with testcode (creating temp tables using Stored procedure print queries), it is showing results. Is there any functionality problem araising while executing procedure? Please help me.

    select c.[value], c.vdescr,r.fcount, d.rcount, e.ccount from

    [10.10.6.30].util_db.dbo.lookup_type c left join

    (select b.actid,isnull(count(distinct a.id),0) as fcount from #trans a

    inner join clien_db.dbo.CC_645_GN b on a.id=b.id group by b.actid) r

    on r.actid=c.[value]

    inner join #rcounts d on 1=1 inner join #ccounts e on 1=1 where

    e.hstatus='n' and d.hstatus='n' order by vdescr

    Thanks in advance.

  • You're using 3 temporary tables in your query -- what is populating those tables when you run this in each of the two scenarios you mention?

    Rob Schripsema
    Propack, Inc.

  • Can you please post some test data?

    ----------------------------------------------------------------------------------------------------------------------------------------------------------------------
    Sometimes, winning is not an issue but trying.
    You can check my BLOG
    [font="Arial Black"]here[/font][/url][/right]

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply