Answers

Mar 26, 2009 - 03:14 AM
You can do that by using #temp_table which will be accessible throw the called store procedures and functions for current session. Note: will be better to drop the table at the end of your work.
example using Northwind DB:
CREATE PROCEDURE Test_GetTempData
-- Add the parameters for the stored procedure here
AS
BEGIN
Select * from #temp_Table
END
CREATE TABLE #temp_Table(
[CustomerID] nchar(5) ,
[CompanyName] nvarchar(40)
)
insert into #temp_Table(CustomerID, CompanyName)
select [CustomerID], [CompanyName] from customers
EXEC[dbo].[Test_GetTempData]
drop table #temp_Table
example using Northwind DB:
CREATE PROCEDURE Test_GetTempData
-- Add the parameters for the stored procedure here
AS
BEGIN
Select * from #temp_Table
END
CREATE TABLE #temp_Table(
[CustomerID] nchar(5) ,
[CompanyName] nvarchar(40)
)
insert into #temp_Table(CustomerID, CompanyName)
select [CustomerID], [CompanyName] from customers
EXEC[dbo].[Test_GetTempData]
drop table #temp_Table

Apr 17, 2009 - 06:25 AM
The question looks to be abandoned by the user who asked it. If no action is taken within 2 days, a Quomon Moderator will consider closing the question and distributing the points.
The Quomon Team
The Quomon Team
Add New Comment