Click here to Skip to main content
13,085,613 members (72,846 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


3 bookmarked
Posted 19 Apr 2011

Time remaining of Database Shrink

, 19 Apr 2011
Rate this:
Please Sign up or sign in to vote.
Time remaining of Database Shrink
I found a stored procedure already in my database (via legacy), and modified it to display remaining seconds and lapsed seconds.

SELECT percent_complete, start_time, status, command, estimated_completion_time/1000/60 As 'Minutes to Completion', total_elapsed_time/1000/60 As 'Minutes Elapsed', wait_type, last_wait_type
FROM sys.dm_exec_requests
order by 'Minutes to Completion' desc

This is useful when you must perform a shrink or another time consuming task. It does not give much help besides "start_time" and "status" for ad hoc queries though.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Software Developer (Senior)
United States United States
What I get paid or have been paid to do:
Trading software and protocols (QuickFIX, Onix, etc).
Price feed development.
Data integration.
Trader simulation tools.
Back office, end of day reporting, NFA compliance.
Performance testing, optimization, and analysis.
Large scale data management, analysis, and visualization.
Worked with most major banks, some electronic exchanges, many data providors, and a few counter-parties:
MISO, PJM, NYISO, NEISO, CAISO, AESO, ERCOT, BOE, CME, CBOE, Eurex, ICE, Morgan Stanley, J.P. Morgan, RBS, EBS, Credit Suisse, Nomura, Barclays, Deutsche Bank, Citibank, UBS, Goldman Sachs, Bear Stearns (defunct), Triaina, Bloomberg
Experience in FX, energies, futures.

You may also be interested in...

Comments and Discussions

GeneralUseful tip, 5* Pin
DrABELL24-Apr-11 16:50
memberDrABELL24-Apr-11 16:50 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web04 | 2.8.170813.1 | Last Updated 19 Apr 2011
Article Copyright 2011 by wizardzz
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid