I like Notepad++ very much, but I can't figure out why would you be interested in buying a software to run queries in it instead of doing it in SSMS.
I'm sorry that I can't help you, but I'm interested on your reasons. 🙂
How to post data/code on a forum to get the best help: Option 1 / Option 2
Are you seriously taking the advice and code from someone from the internet without testing it? Do you at least understand it? Or can it easily kill your server?