Re: What is wrong with this? : select * from (exec sp_helpdb)

From: Aaron Bertrand - MVP (aaron_at_TRASHaspfaq.com)
Date: 05/28/04


Date: Fri, 28 May 2004 12:50:57 -0400


> Thank you, everyone. It looks like this is a limitation of SQL, with a lot
> of workaround.

And some good reasons, too. Stored procedures are not just used for
retrieving data. I have many stored procedures that perform a simple update
or delete statement. So if I say:

SELECT * FROM (exec SomeUpdateProc)

Should the engine try and figure out if I merely meant to execute the
statement? And if so, should it execute it, even though it knows I won't be
getting any results in my select?

-- 
Aaron Bertrand
SQL Server MVP
http://www.aspfaq.com/


Relevant Pages

  • Re: A peculiar problem
    ... > and then to execute them. ... Text manipulation in SQL Server is very hard, ... > 1.Create a batch file with isql utility using an input file and putting ... Export the generated file(with the modified stored procedures) using ...
    (microsoft.public.sqlserver.programming)
  • Re: Poor performance when executing stored procedure
    ... > Generally I would write stored procedures to do only one job. ... If SQL Server ... > which is even worse those sps can execute each other. ... > then executed spOrders which is executed in spCustomers and then got stuck ...
    (microsoft.public.sqlserver.programming)
  • I think our understandings are different
    ... He said "direct execute sql". ... To say that stored procedures are "far ... > select listingId, listingName from Property ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: WLM for toddlers
    ... Just a little nitpicking - enclave SRBs for distributed threads are in xxxxDIST ... load modules will execute in this address space. ... SQL statements (and with ... SQL Stored Procedures) are executed in the DIST address space. ...
    (bit.listserv.ibm-main)
  • Emulate SQLServer Stored procedures in Access
    ... Is it possible to emulate SQLServer Stored procedures in Access? ... Very often this application has to execute a series of SQL statements ...
    (microsoft.public.vb.database)

Quantcast