EF Function Import does not recognise columns returned by StoredProc

GavM

New Member
I have a stored procedure which populates a #temp table, does things to its records and then SELECTs the records.Problem is, when I try to create a function import and click on [Get Column Information], the results pane shows the message "The selected stored procedure or function returns no columns".Now, I KNOW for a fact that it does indeed return columns because if I run it directly from the db, I get the expected resultset back.The stored procedure can be summarised as follows:\[code\]SELECT P.PersonID, P.Surname, P.NickName, P.DateofBirthINTO #SeriesCompleted FROM Table1 T (NOLOCK)INNER JOIN Table2 P (NOLOCK) ON T.PID = P.PID;Select r.PID, SUM(rt.Distance) 'Distance'INTO #DistanceFROM #SeriesCompleted sc inner join table3 rsr (NOLOCK) on rsr.SeriesId = sc.SeriesId inner join table4 r (NOLOCK) on r.PID = sc.PID inner join table5 rt (NOLOCK) on rt.RouteID = r.RouteIDGROUP BY r.PID;UPDATE #SeriesCompletedSET Distance = d.DistanceFROM #SeriesCompleted scINNER JOIN #Distance d on d.PID = sc.PPID;--Here is where the result is returned.SELECT distinct sc.PersonID, sc.NickName, sc.Surname, sc.DateofBirth, sc.NumberFinished, sc.DistanceFROM #SeriesCompleted SC\[/code\]
x65E3.png
 
Back
Top