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

Tech-Archive recommends: Fix windows errors by optimizing your registry

From: Narayana Vyas Kondreddi (answer_me_at_hotmail.com)
Date: 06/01/04


Date: Tue, 1 Jun 2004 08:42:03 +0100

Check @@ROWCOUNT in SQL Server 2000 Books Online, and see if that's what you
are after.

-- 
HTH,
Vyas, MVP (SQL Server)
http://vyaskn.tripod.com/
Is .NET important for a database professional?
http://vyaskn.tripod.com/poll.htm
"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


Relevant Pages

  • Re: Why cant recursive queries contain...?
    ... I still find that I tell that database what I want to do and a lot of the time it does it the wrong way and I have to go back in and tell it how to do it anyway. ... We're still in the very early stages of computing in 2009, do we really want sql2050 to still only be able to return a square block of data from a stored proc? ... "Expert SQL Server 2008 Encryption" ...
    (microsoft.public.sqlserver.programming)
  • Re: Help with SQL 2005 and Sourcesafe 6
    ... that update the stored proc in the database, or do you just simply update it ... We already use Microsoft VIsual SOurcesafe 6 to store our ... Obviously the stored procedures have to be in the database for SQL Server ...
    (microsoft.public.sqlserver.tools)
  • Re: ANSI_WARNINGS inconsistently in effect
    ... Vyas, MVP (SQL Server) ... The problem is that one client is getting an error with the update failing ... I realize that I could put the update in a stored proc and set ANSI_WARNINGS ... The ANSI_WARNINGS db_option for the database is FALSE. ...
    (microsoft.public.sqlserver.clients)
  • Write conflict error after adding trigger to table
    ... I have inherited an Access adp that directly connects to SQL Server. ... that database. ... stored proc in the database window instead of through the form, ... is preventing me from rolling these triggers to production where other apps ...
    (microsoft.public.access.adp.sqlserver)
  • Re: Best way to update/insert/delete in sqlserver database
    ... what client you are using to connect to the database. ... Write your stored proc to do the logic ... > I've passed the last days going around with xml, sqlxml, uppdategrams, ... updates and deletes in db tables (not much so ...
    (microsoft.public.sqlserver.xml)