Passing Data from one sp to other sp using Temp Table.
Hi,
Here I tried a trick, there may be others trick also to do the same.
CREATE PROCEDURE Proc_Record_Insertion AS
-- This #Temp1 table is defined in the other sp which I am using here.
INSERT INTO #Temp1(id,info) VALUES(1,'Mohammad') INSERT INTO #Temp1(id,info) VALUES(2,'Irfan'); INSERT INTO #Temp1(id,info) VALUES(3,'matespoint@gmail.com'); INSERT INTO #Temp1(id,info) VALUES(4,'matespoint.blogspot.com');
GO -- This will create a sp Proc_TempTableCreate which create a Temp table and insert four recors into it.
CREATE PROCEDURE Proc_UseTempData AS
BEGIN
CREATE TABLE #Temp1 (id int, info varchar(40) ) -- Executing the sp EXEC Proc_Record_Insertion SELECT * FROM #Temp1 END
For more details, visit http://matespoint.blogspot.com/2008/03/passing-data-from-one-sp-to-other-sp.html
|
| Author: UltimateRengan 10 Jul 2008 | Member Level: Diamond Points : 0 |
hi, good one , continue posting such valuable things
|