Hi
I have a chunky bit of sql that I will want to call from a number of
places. It will return a
few thousand rows. Whats the best way of structuring this?
1) I initially thought of using nested stored procedures and returning
the result in a temporary
table. However the scope of the temporary table seems to be limited to
the stored procedure
its created in so unless I create the temporary table in every stored
proc that needs to use
this generic one it won't work. If I create it in the generic stored
proc then the called stored procs can't see it
2) Insert the rows into a real table with a guid. Once the call has
finished delete those rows.
Scoping is now not an issue?
3) A view? I haven't had any experience with these but I don't believe
they can take arguments
which makes them useless for this
At the moment it seems the most efficient way is possibly to accept
the cut and paste of (1)
and go that way
Any suggestions?
ta