October 27, 2004 at 11:12 am
i need help to insert to #temp table from Stored Procedures
like this
----------------------
1 )to insert to the #temp table from Stored Procedures(10 Fields)
2) after make a select (filtering the #tamp table)
3) insert to the main table (only after filtering the #tamp table)
4 ) delete the #tamp table
----------------------------
and all in one Stored Procedures !!!
-------------------------------------
thnks ilan
October 28, 2004 at 1:55 am
Could you give an example?
I'm not sure what exactly you want to do.
--
Frank Kalis
Microsoft SQL Server MVP
Webmaster: http://www.insidesql.org/blogs
My blog: http://www.insidesql.org/blogs/frankkalis/[/url]
October 28, 2004 at 2:13 am
Do you mean this
CREATE TABLE #temp (col1 int, col2 int, ...)
INSERT INTO #temp
EXECUTE procname
INSERT INTO #temp
EXECUTE anotherproc
INSERT INTO [maintable]
SELECT col1, col2, ...
FROM #temp
WHERE [some criteria]
DROP TABLE #temp
Remember the #temp table must the correct number and type of columns to match what the procs produce.
Far away is close at hand in the images of elsewhere.
Anon.
November 2, 2004 at 11:30 am
Why dont you use ##temp instead #temp ?
##temp is a global temporary table, and you can reference it from any connection, with the name you create it.
Alejandro Claver
Cali, Colombia
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply