SQL-Server: Is there a SQL script that I can use to determine the progress of a SQL Server backup or restore process?

I found this sample script here that seems to be working pretty well: SELECT r.session_id , r.command , CONVERT(NUMERIC(6,2), r.percent_complete) AS [Percent Complete] , CONVERT(VARCHAR(20), DATEADD(ms,r.estimated_completion_time,GetDate()),20) AS [ETA Completion Time] , CONVERT(NUMERIC(10,2), r.total_elapsed_time/1000.0/60.0) AS [Elapsed Min] , CONVERT(NUMERIC(10,2), r.estimated_completion_time/1000.0/60.0) AS [ETA Min] , CONVERT(NUMERIC(10,2), r.estimated_completion_time/1000.0/60.0/60.0) AS [ETA Hours] , CONVERT(VARCHAR(1000), (SELECT SUBSTRING(text,r.statement_start_offset/2, CASE WHEN r.statement_end_offset … Read more

restoring git repository from bundle backup

Short answer: $ git bundle verify $somewhere/foo.bundle $ git clone $somewhere/foo.bundle Cloning into ‘foo’… Receiving objects: 100% (10133/10133), 82.03 MiB | 74.25 MiB/s, done. Resolving deltas: 100% (5436/5436), done. $ cd foo $ git status … Lazy Badger said this, but it’s in the last paragraph. 🙂

How to restore a minimized Window in code-behind?

Not sure this will work for everybody, but I ran into this today and someone on the team suggested “have you tried Normal“? Turns out he was right. The following seems to nicely restore your window: if (myWindow.WindowState == WindowState.Minimized) myWindow.WindowState = WindowState.Normal; That works just fine, restoring the window to Maximized if needed. It … Read more

Opening a SQL Server .bak file (Not restoring!)

From SQL Server 2008 SSMS (SQL Server Management Studio), simply: Connect to your database instance (for example, “localhost\sqlexpress”) Either: a) Select the database you want to restore to; or, alternatively b) Just create a new, empty database to restore to. Right-click, Tasks, Restore, Database Device, […], Add, Browse to your .bak file Select the backup. … Read more