Solved
procedure with OUTPUT
Posted on 2006-11-07
i've got a proc with output parameters within. it does a bunch of calculations, and returns data under certain conditions. recently i received help revising that procedure such that it can invoke an email, IF output = 1 is returned.
i'm trying to do that again, but am unable to because the proc i am working with now has parameters. there were no parameters with the other one, i fire it like this:
DECLARE @spcount BIT
EXEC db.dbo.procname @spcount OUTPUT
if data is to be returned, @output is set to 1. so, if the proc has results, OUTPUT = 1
i'm trying to make a similar version of this with a new procedure, but this one has parameters and i'm having difficulty. see, it's a 3-step process
1) run the procedure
2) update a to-be-mailed flag ONLY if the procedure returns results
3) send the email, where the flag = 1 (email includes resultset)
so, if my proc has parameters, and is fired like this: exec procname param1, param2, param3
how do i handle the OUTPUT?
i'm not sure if i voiced myself adequately. any thoughts?