Yesterday night, I received a phone call from one of my friends with whom I used to work in USA. I was very pleased to receive this call from my old friend after 2 years, but the situation was not good on his side. He said that whatever query he runs, he just receives a message like Query Command(s) completed successfully without any result. However, when he opened a new window, it worked fine. He said he could not figure out the reason for the same and his manager who was standing nearby asked him to find out the reason and not to close the window till he figures this out. Hmm… I really find this whole story very funny. I just thought this was overkill for them to call me all the way to India for this question. Of course, I told him that I do not believe his story at all!
Well in short, I remote logged in to his system and found out that his particular session, which was not returning any result, had one of the query settings set wrong.
As soon as the settings were unchecked, everything seemed to work fine. We could have used T-SQL to turn this option off and also the SET PARSEONLY OFF option.
We both had a really good time after that talking about old times. Anyway I still believe that there was no emergency, and he just wanted to call me at an odd time!
Reference: Pinal Dave (https://blog.sqlauthority.com)
I am experiencing this same problem; a SELECT Distinct query returns “Command Completed Successfully” regardless of qty of rows actually in the result set. I double checked and verified that SET PARSEONLY is unchecked by default.