I\'m currently running the following statement
select * into adhoc..san_savedi from dps_san..savedi_record
It\'s taking a painfully long time a
A few issues to consider here. Is dps_san..savedi_record a view? If so, it could just be taking a really long time to get your data. The other thing I can think of is that you're trying to create a temp table by using the select into
syntax, which is a bad idea. select * into ...
syntax will lock the tempdb for duration of the select.
If you are creating the table using that syntax, then there is a workaround. First, create the table by throwing where 1=0
at the end of your initial statement:
select * into ... from ... where 1=0
This will create the table first (which is quick) which allows you to insert into
because the table exists now (without penalty of locking tempdb for duration of query).