posted 19 years ago
When you say "temp table" do you mean a temporary, i.e. # table, or a temporary copy of a permanent table?
The simplest way to do either is with SELECT INTO. Note that SELECT INTO is not really suitable for production use due to issues with locking and logging (lack thereof).
You have to be SA or DBO to do the above. Note that it won't copy constraints, indexes, etc. If you only want a temporary table (lasts as long as your session) do the following:
Jules