CodeIgniter Forums
MS SQL and stored Procs - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: MS SQL and stored Procs (/showthread.php?tid=30965)



MS SQL and stored Procs - El Forum - 06-01-2010

[eluser]btwong[/eluser]
I am calling a stored procedure from a Ms SQL database, but i am getting nothing returned.

Looking at the stored procedure, i can see that it gets all the required data, and puts it in a #Temp table. Then on the second last line it does a "select * from #temp".

The last line then does a "drop table #Temp".

How can i use php/codeigniter to get all the records/data from the "Select * from #Temp" query before the #Temp table is dropped?

thanks


MS SQL and stored Procs - El Forum - 06-02-2010

[eluser]Kamarg[/eluser]
When using temp tables in MSSQL you don't need a drop table statement as the table scope is limited to the session in which it is created and will be automatically dropped when the session ends. Not sure if that will solve your problem or not but it's worth a shot.


MS SQL and stored Procs - El Forum - 06-14-2010

[eluser]btwong[/eluser]
thanks for that.