I noticed a behavior which comes to me as a very wierd one. If I make an insert-select statement and the select part returns no data, the insert part still executes and even insert trigger is called (in insert trigger there is 0 rows in inserted pseudotable).
Example:
insert into table1 column1
select column1 from table2 where condition = 'Never met'
Output:
(0 row(s) affected) // 0 rows inserted
(1 row(s) affected) // log from trigger
May it be caused by 'universal' trigger (declared FOR INSERT, UPDATE, DELETE at once)? I know that this is more like hypothetical question and I have to accept this behavior. But why is this happening? It makes no sense to me. I am using SQL Server 2005.
-- kwitee