Re: Temporary results used by SP

From: Tibor Karaszi (tibor_please.no.email_karaszi_at_hotmail.nomail.com)
Date: 01/04/05


Date: Tue, 4 Jan 2005 13:34:57 +0100

You can create the temp table prior to the execution of the stored procedure and have the sp insert
etc the data in it and then use the data after the execution of the procedure.

-- 
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
http://www.sqlug.se/
"FGItaly" <FGItaly@discussions.microsoft.com> wrote in message 
news:4CA935A9-232F-49BD-8C8F-76FE49F24B3B@microsoft.com...
> In a MS Access Application you can use the "link table" to connect to a
> common mdb file for the main database and a local mdb file for temp
> tables/results.
>
> How to reproduce this scenario in Sql Server ?
> From VB.NET these are the steps I would like to perform:
> a) call a SP to do the heavy works, querying multiple tables and fill the
> result table "xyz"
> b) use the data in "xyz" to do something
> c) drop the "xyz" table
>
> I can't use #temp tables cause they will be dropped at the end of the SP. If
> I use a permanent table, what about if two or more users do the same
> operation ? And what about performance ?
>
> 


Relevant Pages

  • Re: Using temp tables
    ... you can store the data in Temporary tables or Physical ... The source for information on temp tables is - BOL- Books online is the best ... should be same as output of stored procedure. ... The difference is local temp tables are visible only to the execution. ...
    (microsoft.public.sqlserver.programming)
  • Re: SQL server 2005 Express - Vista - Invalid object name #spdbdesc
    ... #tableName refers to a temp table-- does it exist when you're doing this? ... the sproc execution automagically ... Used server manager to create user login with sysadmin role. ... my application executes the stored procedure "sp_helpdb" ...
    (microsoft.public.sqlserver.msde)
  • SET IDENTITY_INSERT Privileges?
    ... We have a "SET IDENTITY_INSERT " statement in a stored procedure and the ... stored procedure has been granted execution privileges to a user 'xyz'. ... How do I grant permission to a SET Statement?? ...
    (microsoft.public.sqlserver.security)
  • Re: SQLserver and the WHERE x IN y
    ... to a stored procedure - that would only work if you introduced subtyping into ... the temp table from the calling procedure (the temp table is still in scope, ... INSERT INTO #MyTempTable EXECUTE YourPopulateProc 123 ... INSERT INTO @MyTableVar VALUES ...
    (microsoft.public.sqlserver.programming)
  • Re: Indented Bill of Materials
    ... have no parent are inserted in a temp table, ... execution of the WHILE statement, the last executed statement is the SET ... In the first iteration, @lev will be increased to 1. ...
    (microsoft.public.sqlserver.programming)