Re: Using temp tables
From: avnrao (avn_at_newsgroups.com)
Date: 01/06/05
- Next message: avnrao: "Re: Dynamic Server Reference in T-SQL"
- Previous message: Andy: "Re: Thoughts - Saving Word documents in SQL Server?"
- In reply to: Roy Goldhammer: "Using temp tables"
- Next in thread: Yitzak: "Re: Using temp tables"
- Reply: Yitzak: "Re: Using temp tables"
- Messages sorted by: [ date ] [ thread ]
Date: Thu, 6 Jan 2005 16:48:12 +0530
Hi Roy,
If you need the result set of stored procedure during the execution of
procedure that calls, you can store the data in Temporary tables or Physical
tables.
The source for information on temp tables is - BOL- Books online is the best
place. Look for Temporary Tables in the index.
You can store the result set as
Create Table #MyResultSet (Column Int.) -- Generally structure of this
should be same as output of stored procedure.
Insert Into #MyResultSet Exec Stored Proc --Here Temp table #MyResultSet
should be defined earlier
There are two types of Temp tables. local and global. local temp tables are
created as #TableName, and global are created as ##GlobalTableName.
The difference is local temp tables are visible only to the execution.
Meaning if you call a stored proc that creates a temp table, the temp table
is visible to the execution of this proc, or in any procs called by the main
proc. Global temp table is visible to other processes. it exists even after
its creator's execution gets completed.
> By that time this dable should be watching on all the network.
what does this mean?
-- Av. http://dotnetjunkies.com/WebLog/avnrao http://www28.brinkster.com/avdotnet "Roy Goldhammer" <roygoldh@hotmail.com> wrote in message news:e7LqTw98EHA.3840@tk2msftngp13.phx.gbl... > Hello there > > I have application on sql server 2000 > > In the application i need sometimes to store result of store procedures or > other things into tables for some time and destroy it afterword. By that > time this dable should be watching on all the network. > > As I understand i should use temp tables for this. The question is how can i > create them, use them outside and destroy them? > > any help would be useful > >
- Next message: avnrao: "Re: Dynamic Server Reference in T-SQL"
- Previous message: Andy: "Re: Thoughts - Saving Word documents in SQL Server?"
- In reply to: Roy Goldhammer: "Using temp tables"
- Next in thread: Yitzak: "Re: Using temp tables"
- Reply: Yitzak: "Re: Using temp tables"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|