Re: restore using wildcard
From: Eric Sabine (mopar41_at_____h_o_t_m_a_i_l_._ScPoAmM)
Date: 03/05/04
- Next message: Quentin Ran: "Re: Scheduled job question"
- Previous message: Tim Vernon: "Problem merging two queries"
- In reply to: JT: "restore using wildcard"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 5 Mar 2004 12:29:01 -0500
But you wouldn't want to restore all of the backups as in theory the * would
do for you. Do you just want to automate the restoration of the _last_
backup? Since all backups are being written to new files, then utilize
xp_cmdshell and the DIR command to find the newest filename. Then build
your script dynamically. Alternatively, you could backup your database to
the same file and then do a RESTORE FILELISTONLY and get the position number
(most likely the MAX one) and restore by specifying the position.
hth
Eric
"JT" <anonymous@discussions.microsoft.com> wrote in message
news:7f6501c402d5$15714190$a101280a@phx.gbl...
> i have a scheduled backup that occurs on a nightly basis.
> the backup file is given a name with a date stamp - so
> that each day the name is unique.
>
> im wondering if it is possible to use a wildcard character
> when specifying what file to restore
>
> for example:
>
> restore database spp_temp
> from disk = 'c:\DevBkup\DevBkup03032004.bak'
>
> but this won't work:
> restore database spp_temp
> from disk = 'c:\DevBkup\DevBkup*.bak'
>
> any suggestions would be greatly appreciated
>
> thanks
>
> jt
>
- Next message: Quentin Ran: "Re: Scheduled job question"
- Previous message: Tim Vernon: "Problem merging two queries"
- In reply to: JT: "restore using wildcard"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|