If I have a script that involved dropping and creating two tables and the desired output is a table with three fields should I be using a procedure or a multi-statement function? I am just delving into programmatic sql. I have spent some time trying to research on google, etc but can't figure it out. Thx again, you guys are the best!
No, I am writing it against the back end, SQL Server 2005 (sorry, forgot to mention the version). We have a very simple Access front end where we have been entering queries to call the data we want. We update the queries using this front end and we have written functions for the other reports we want to run. This particular query is different, however, in that it is the only that has two sub tables where I am rolling up data for further, subsequent processing.
I am temporarily placing data into tables to process. I can use temp tables instead or I can delete from table1 and then insert into table1 instead. I currently am using an "if exists" clause, drop the table, and re-create it. That is just the way I was once taught.