Search
 
SCRIPT & CODE EXAMPLE
 

SQL

Check database restore status sql script

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 = -1 THEN 1000 ELSE (r.statement_end_offset-r.statement_start_offset)/2 END)
FROM sys.dm_exec_sql_text(sql_handle))) AS [SQL]
FROM sys.dm_exec_requests r WHERE command IN ('RESTORE DATABASE','BACKUP DATABASE')
Comment

PREVIOUS NEXT
Code Example
Sql :: restore backup to new database sql server 
Sql :: mysql récupérer le code création de vue 
Sql :: mysql select date range last 30 days 
Sql :: mysql update two tables at once 
Sql :: mysql money value 
Sql :: update join sql 
Sql :: change mariadb to mysql xampp 
Sql :: change data type postgresql 
Sql :: how to lock table in mysql 
Sql :: sql if clause within where clause 
Sql :: postgresql not case sensitive where in 
Sql :: sql server insert inner join 
Sql :: sql show table info 
Sql :: drop a view in sqlite 
Sql :: MySQL get all previous date record 
Sql :: sql format time 
Sql :: reindexing all tables sql server 
Sql :: oracle index size calculation 
Sql :: how to select an index in oracle sql 
Sql :: power bi dax is in the last 3 months 
Sql :: sql server md5 hash 
Sql :: object dependencies in oracle 
Sql :: Client does not support authentication protocol requested by server; consider upgrading MySQL client 
Sql :: SQL check if record exist 
Sql :: mysql max 
Sql :: sql server delete table 
Sql :: mysql biginteger size 
Sql :: ms sql mac 
Sql :: sql create tabel with primary key auto_increment code 
Sql :: auto increment column in mysql query results 
ADD CONTENT
Topic
Content
Source link
Name
4+5 =