Re: How to tell if a stored proc included a Select statement
From: Tim (Tim_at_NoSpam)
Date: 06/01/04
- Previous message: Tibor Karaszi: "Re: isolation levels"
- In reply to: Ian Tompsett: "Re: How to tell if a stored proc included a Select statement"
- Next in thread: Ian Tompsett: "Re: How to tell if a stored proc included a Select statement"
- Reply: Ian Tompsett: "Re: How to tell if a stored proc included a Select statement"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 1 Jun 2004 20:36:33 +1200
Ian,
You could have an SP - say mysp_comment that you run between each actual SP
call so that the caller can have 'delimited' output.
CREATE PROC mysp_comment @comment varchar(80)
AS
SELECT @comment
GO
You still won't know in advance how many resultsets are created, but you
will be able to attribute result sets returned to each SP called & of course
combine this with NextRecordset as Narayana said.
EG
EXEC mysp_Comment 'sp_1 follows'
EXEC sp_1
EXEC mysp_Comment 'sp_2 follow2'
EXEC sp_2
etc...
- Tim
"Ian Tompsett" <anonymous@discussions.microsoft.com> wrote in message
news:F581C020-BBD2-42E6-B650-3AFBBF3FE550@microsoft.com...
> Thanks Vyas
>
> I'm hoping to call a number of stored procedures from C# (through ADO.NET)
> in one database call. To allow me to synchronise the result sets from the
> database call I would like to return as many result sets from the DB as
> there are stored procs called. So I would like to be able to tell in a
> T-sql stored proc whether another stored proc that it has called populated
> a result set. If it has, there's nothing more to do. If it hasn't, I'll
> just I'll populate a kind of empty result set that can be recognised in
> the C# code as one to ignore.
>
> The relevant question: if one T-sql stored proc calls another T-sql stored
> proc, can the calling sproc know if the called sproc populated a result
> set?
>
> (I hope my terminology is correct - by "result set" I mean the results of
> a select statement that isn't stashed away into any variables. So it will
> be available in the calling ADO.NET as a DataTable within a DataSet.
> Easiest example: "select * from someTable")
>
> Just FYI - the call into the DB from C# will be contain an XML string.
> This string will contain a series of elements, each containing the name of
> the actual sproc to call. So I want as many result sets as there were
> stored procs called.
>
> Thanks again
>
> Ian
- Previous message: Tibor Karaszi: "Re: isolation levels"
- In reply to: Ian Tompsett: "Re: How to tell if a stored proc included a Select statement"
- Next in thread: Ian Tompsett: "Re: How to tell if a stored proc included a Select statement"
- Reply: Ian Tompsett: "Re: How to tell if a stored proc included a Select statement"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|