troubleshooting Question

count number of records in stored procedure

Avatar of timohorn
timohornFlag for Netherlands asked on
Microsoft AccessMicrosoft DevelopmentSQL
2 Comments1 Solution334 ViewsLast Modified:
i want to know if a stored procedure has records, because if it does n't i want to skip a part of my code .
i'm printing several reports, in a batch and when a record has no data it ends the batch.

the code that i'm using is

where ajar and rechthebbende are values from the main form
"SELECT count DISTINCT dbo.ro_results.ISBN, dbo.PI_rechthebbende.btw,, dbo.PI_rechthebbende.Rechthebbende_nr, " _
                & "  dbo.PI_artikel_informatie.actief, dbo.ro_results.Rol, dbo.[PI_ISBN-Rechthebbende].Rechthebbende_nr AS Expr2, dbo.PI_rechthebbende.voorletters, " _
                & "  dbo.ro_results.Jaar , dbo.[PI_ISBN-Rechthebbende].Verdeelsleutel " _
                & "  FROM  dbo.PI_rechthebbende INNER JOIN  dbo.PI_artikel_informatie INNER JOIN dbo.ro_results ON dbo.PI_artikel_informatie.ISBN = dbo.ro_results.ISBN INNER JOIN " _
                & "  dbo.[PI_ISBN-Rechthebbende] ON dbo.PI_artikel_informatie.ISBN = dbo.[PI_ISBN-Rechthebbende].ISBN AND " _
                & "  dbo.ro_results.Rol = dbo.[PI_ISBN-Rechthebbende].Rol ON " _
                & "  dbo.PI_rechthebbende.Rechthebbende_nr = dbo.[PI_ISBN-Rechthebbende].Rechthebbende " _
            & " WHERE  (NOT (dbo.[PI_ISBN-Rechthebbende].Rechthebbende_nr IS NULL)) AND (dbo.PI_rechthebbende.Rechthebbende_nr = ' " & Rechthebbende & " ')" _
            & " AND (dbo.ro_results.jaar = ' " & Jaar & " ')"
Anuradha Goli
Anuradha Goli (anuradhay)

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 2 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 2 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros