I think I might be going mad, certainly boz eyed. Grateful for a second pair of eyes & brain cells.
So I have a small script that emails out the results of a query. I can't cut & paste easily between systems into this window for boring reasons. So the gist is as follows:
Create global temp table
Insert values
sp_send_dbmail @query = 'SELECT * FROM global temp table'
Drop global temp table.
This works, as in the mail appears in my inbox, when I have > 1 row in my temp table.
It fails when there is only 1 row - (fails as in says "Mail queued" but the mail never appears).
This is the only difference between success and failure:
INSERT ##a VALUES (1), (2) -- mail appears
INSERT ##a VALUES (1) -- mail doesn't appear.
Is this a known issues / something I'm doing wrong?
SQL 2008 R2S