Timeline for How exactly does sp_msforeachdb work behind the scenes?
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 8, 2020 at 4:43 | history | edited | Aaron Bertrand | CC BY-SA 4.0 |
added 157 characters in body
|
Sep 12, 2016 at 18:29 | vote | accept | Jeff.Clark | ||
Sep 12, 2016 at 18:25 | comment | added | Kris Gruttemeyer | I've seen it skip DBs completely on more than one occasion. Use Aaron's, it's much more reliable. | |
Sep 12, 2016 at 18:22 | comment | added | Kenneth Fisher | Cursors are only a real performance problem when you have more than a few rows. Unless you were getting close to the max # of databases allowed you wouldn't see an issue. The problem is that it can skip databases. Read Aaron's article and he goes into more detail. | |
Sep 12, 2016 at 18:20 | comment | added | Jeff.Clark | Interesting, using brackets around the "?" in the from did work. I will look into Aaron Bertrand's version. Have you noticed a significant degradation of performance because of the cursor? | |
Sep 12, 2016 at 18:17 | history | answered | Kenneth Fisher | CC BY-SA 3.0 |