DBAWinnipeg
Programmer
OK Once again I'm at the mercy of you fine tek-tip coding machines
(Manditory suck up for quick response) heehhe
OK we do backups through the maintenance planner so our file names are as follows:
PROD_db_200404200102.bak
Now if I try and restore that file via a script
RESTORE DATABASE CRMREP
FROM DISK = '\\crmprd01\Data\CRMPRD_db_200404200102.BAK'
I'm wondering 2 things
1) does the Restore Database function accept wildcards
ie) CRMPRD_db_*.BAK
or
2) does anyone have a script to run that will search a folder for a file with a wildcard (CRMPRD_db_*.BAK) and return the complete file name which I then could use in my RESTORE DATABASE script.
Thanks in advance!!!
Colin in da 'Peg
(Manditory suck up for quick response) heehhe
OK we do backups through the maintenance planner so our file names are as follows:
PROD_db_200404200102.bak
Now if I try and restore that file via a script
RESTORE DATABASE CRMREP
FROM DISK = '\\crmprd01\Data\CRMPRD_db_200404200102.BAK'
I'm wondering 2 things
1) does the Restore Database function accept wildcards
ie) CRMPRD_db_*.BAK
or
2) does anyone have a script to run that will search a folder for a file with a wildcard (CRMPRD_db_*.BAK) and return the complete file name which I then could use in my RESTORE DATABASE script.
Thanks in advance!!!
Colin in da 'Peg