UNSOLVED

GJones1

updated

1 year ago

G

GJones1

1 Rookie

•

9 Posts

0

143

January 31st, 2024 22:48

Using emc_run_restore, is there a way to only restore the latest full backup regardless of date\time?

Trying to automate a restore of a SQL database to another server using T-SQL with emc_run_restore, but do not need all the log files.  Only want the restore latest FULL backup.  Is there a switch for that?

  • Joe McBratnie

    1 Rookie

    •

    1 Message

    •

    2 Points

    0

    0

    Posted August 22nd, 2025 12:24

    I have gotten around this by querying the source server msdb.dbo.backupmediafamily and msdb.dbo.backupset to build the required string.  Note the time is has a rounding issue.  SQL uses hh:mm:ss.xxx and emc_run_restore is hh:mm:ss, so you might need a little extra logic here.  Also I use powershell to capture this and run a restore and DBCC CheckDB on a jump server.