Re: Temp Table / Stored Procedure Question
From: Colin Angus Mackay (colin.angus.mackay_at_gmail.com)
Date: 12/15/04
- Next message: John Baima: "Re: Getting the right number of records back"
- Previous message: Dan Guzman: "Re: transaction isolation level"
- In reply to: Joe Williams: "Temp Table / Stored Procedure Question"
- Next in thread: Joe Williams: "Re: Temp Table / Stored Procedure Question"
- Reply: Joe Williams: "Re: Temp Table / Stored Procedure Question"
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 15 Dec 2004 01:17:59 +0000
You create a temp table like any other except that the table name is
prefixed with a hash (#) character. Note that at the end of the stored
procedure the table will be dropped automatically.
If in your stored procedures you have a SELECT.... to return data out
then in your calling stored procedure all you need is:
INSERT #MyTempTable1
EXEC MyStoredProcedure @param1 = ''.... (or what ever you need)
Then you can perform a join as normal on the temp tables.
Does this help?
Joe Williams wrote:
> I am following up on some earlier posts I had:
>
> I have a procedure that calls two other stored procedures. I would like the
> values from the two stored procedures to be stored into a temp table and
> then as teh final step in my stored procedure, to join these two temp tables
> together and do a SELECT * to get all the data out.
>
> What is the process for declaring a temp table, then executing the stored
> procedure so that the data is stored into this newly created temp table?
>
> Thanks
>
> Joe
>
>
-- - Developer Services Provider: http://wdevs.com For Blogs, FTP, Mail, Forums, Members Product Areas - My Blog: http://blogs.wdevs.com/ColinAngusMackay
- Next message: John Baima: "Re: Getting the right number of records back"
- Previous message: Dan Guzman: "Re: transaction isolation level"
- In reply to: Joe Williams: "Temp Table / Stored Procedure Question"
- Next in thread: Joe Williams: "Re: Temp Table / Stored Procedure Question"
- Reply: Joe Williams: "Re: Temp Table / Stored Procedure Question"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|