Call StoredProcedure that have TempTable

Jan 14 2016 4:51 AM

I have a stored procedure that returning Temp Table. How can I call this SP using LINQ???


Create PROCEDURE [dbo].[Sp_Test]
@UserID int
AS
BEGIN

Create Table #TempTable
(
RowNumber int Identity(1,1),
UserID int,
UserName nvarchar(250),
Designation nvarchar(250),
Department nvarchar(250),
JobFamily nvarchar(250)
)


Insert Into #TempTable (UserID, UserName, Designation, Department, JobFamily)
Values (1,'Test Name1','Designation1','Department1','Job Family1')

Insert Into #TempTable (UserID, UserName, Designation, Department, JobFamily)
Values (2,'Test Name2','Designation2','Department2','Job Family2')

Insert Into #TempTable (UserID, UserName, Designation, Department, JobFamily)
Values (3,'Test Name3','Designation3','Department3','Job Family3')

Insert Into #TempTable (UserID, UserName, Designation, Department, JobFamily)
Values (4,'Test Name4','Designation4','Department4','Job Family4')

Insert Into #TempTable (UserID, UserName, Designation, Department, JobFamily)
Values (5,'Test Name5','Designation5','Department5','Job Family5')

Select UserID, UserName, Designation, Department, JobFamily
From
#TempTable

END

Answers (4)