• Unless I have missed something in your requirements, will the following give you ther required results:

    CREATE PROCEDURE myprocedure

    @out_var1 varchar(5) OUTPUT,

    @out_var2 varchar(5) OUTPUT,

    @out_var3 varchar(5) OUTPUT,

    AS

    BEGIN

    set @out_var1 = (select count(id) as count2 from foobar where theId = '2')

    set @out_var2 = (select count(id) as count2 from foobar where theId = '2')

    set @out_var3 = (select count(id) as count2 from foobar where theId = '3')

    return

    end