Re: insert into temp table based on if condition



This guy had the same problem:
http://www.experts-exchange.com/Databases/Microsoft_SQL_Server/Q_21594067.html

Doesn't look like they found much of a solution :(

Maybe you could try something with table variables and dynamic SQL?

.