
temporary tables in stored procedures/parameter views vs stored procedures
What is the cost of creating a cursor by
using a remote view (eg, a select statement eminating from the front end)
using a server based view ( the select statement is a view definition in
the database) or
using a stored procedure on the database and called via SQLEXEC to create
the cursor?
I seem to have more success using temporary tables in stored procs rather
than views. I'm beginning to think its not a good idea to select into t1
for example, but to select into #t1, but it seems easier in sps than in
views. GO makes the temp tables go out of scope unless it's the last piece
of the script!
I also need to deal with the issue of parameter passing and outer joins.
These are specifiable in the front end, but I've found it more efficient to
write the sql than play with the view designer, and examine the sql at arms
length. Are sps the only vehicle that accept parameters?
I got here because the SQL I needed had to do a distinct on a text type, so
I was backed into creating the result set in stages ( hence the temp
tables) where I create the substrate that will accommodate the join I neeed
to include a text field.
Thanks all for your pateince and help
Drew