Relative Content

Tag Archive for sql-serverdynamic-sqlsp-executesql

sp_executesql In Loop Taking FOREVER to Run. Slowing down as it runs. Memory Leak?

Long and short is that my query is taking FOREVER to run and I think it has to do with the sp_executesql queries. Yes, there are loops, and yes I am using Dynamic SQL. No, I do not really understand CTEs and can never get them to work, or worse I use one someone suggested and then I break it later and I don’t understand it well enough to fix it. So here we are.