When executing the PRINT "Hello World" query, the output is returned as console output (string), and fetchall considers the result set (object) from the request. RAISERROR is an error condition and may stop the process. I'm not saying that this is not a solution, but maybe you just want to print some feedback without creating error conditions.
I think you can achieve the result you are looking for by changing
[PRINT 'Hello World'] on [SELECT 'Hello World']
I think this will create one row of data in the result set with the text you need, which should appear in fetchall and see if you get the expected results.
Hope that an alternative that you can try will help!
Chef slagle
source share