sql server - Is there a way to pause or wait for a few moments from within a script? -
i assume ask typically fall within realm of "bad practice" want ask regardless because functionality useful diagnosing problems , bench marking long running scripts.
in short, there function built sql server call allow me 'pause' short period of time?
i have nightly ssis process after exporting data generates various subsets of statistical data. whenever have trouble execution times of ssis package, have series of diagnostic stored procedures can call diagnose @ export/bulk insert taking exceptionally long execute.
during second half of ssis process, generate statistical data, beneficial if analyze process may bogging down or analyze how fast can modify data in data tables. of statical procedure begin inserting data table cycled through via while loops , updated when necessary conditions met.
i can query data capture specific metric while statistical stored procedures executing. grab metric, wait 1 second (or specific amount of time) , grab metric again can compare them.
by being able implement 'pause', can create more robust diagnostic scripts out put how many inserts, updates or calculations begin executed per sec , can estimate portions of bigger procedures taking longest.
i assume there may diagnostic tools use within sql server management studio. admit, haven't tinkered of that. however, if there tool within ssms of back-end functionality can mimicked form of fancy scripting. possible limitation using built-in diagnostics i'd prefer run these metrics while ssis package running not while testing stored procedures execute within package.
thanks guys solutions or tips! request isn't 100% necessary nightly ssis packages becoming massive , i'm having start fine tuning "squeeky wheels" i've been able ignore in past.
perhaps looking waitfor delay
Comments
Post a Comment