I'm not a general IT expert. Sometimes with SQL queries ... they will take 10 seconds about 95% of the time.
Every so often, the exact same query will take 5-10 minutes. As will others. The constant is the host computer and current time --- not the query itself.
I'm just wondering if there's any way for me to test or verify what the problem is that is slowing down the query (and that it is, indeed, slowing the query). Would I remote into the host machine and check the memory usage/ processes? The host machine is also in a foreign country --- USA to Germany. Again, 95% of the time, this doesn't matter. I'm wondering if there are temporary 'network spike' issues. I want to know so I can actually complain to IT there ... but I want to pinpoint exactly what's causing the query issues. Maybe this is out of scope of this board ... I know a showplan wouldn't really indicate anything ... or would it? Would network or memory issues slow all steps the same duration? Is there an easier way to troubleshoot this?
SELECT @var1 = col1, @var2 = col2...
this way nothing goes to client, all happens on the server – sepupic Mar 7 '18 at 7:53