Re: How to tell if a stored proc included a Select statement

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Tim (Tim_at_NoSpam)
Date: 06/01/04

  • Next message: Hugo Kornelis: "Re: URGENT : Maximum number of Unions"
    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


  • Next message: Hugo Kornelis: "Re: URGENT : Maximum number of Unions"

    Relevant Pages

    • Timeout fixed by recompile
      ... 200+gig db with 3 databases and hundreds of ... Its sql server 2000 and asp.net 1.1. ... one of our stored procs where it decides it will no longer complete ... We have thousands of users and this proc is run constantly. ...
      (comp.databases.ms-sqlserver)
    • Re: Modelers / code generators
      ... > dynamic SQL versus stored procs. ... extensive calculations on a lot of data, often this is done better in the ... >> a proc with another one, requires you to remove the old proc, however that ...
      (microsoft.public.dotnet.languages.csharp)
    • How to find the runtime for a Stored Proc
      ... I am a Crystal Reports Developer and I was told to create Stored Procs ... And the time that they want is only for Execution time. ... they just want the time from the sec I start the Proc ...
      (comp.databases.oracle.server)
    • Re: SqlDataAdapter1.SelectCommand.CommandType= CommandType.StoredProcedure
      ... >> kann man beim EXEC PROC keine Parameter beifügen. ... > da das TDS Protokoll das intern unterscheiden kann. ... > nach der Ausführung ungültig werden. ...
      (microsoft.public.de.german.entwickler.dotnet.datenbank)
    • Re: using nexted procs
      ... So I have a cataloged proc 'FJS.PDSE.PROC' that looks like this: ... //IEFRDER DD DUMMY //SYSUOUT DD SYSOUT=* ... //FFND05 EXEC DLIBATCH,DLIPGM=FFND05,DLIPSB=FFUNDGO ... Our goal was that when testing we would execute the production proc and override the DD names to the names of test files. ...
      (bit.listserv.ibm-main)