Automatically Restores All database ".BAK" Files

  • Comments posted to this topic are about the item Automatically Restores All database ".BAK" Files

    "-=Still Learning=-"

    Lester Policarpio

  • I only changed the path and the execution of the sproc renders the following error:

    Msg 536, Level 16, State 5, Procedure usp_restore_db, Line 58

    Invalid length parameter passed to the SUBSTRING function.

    which appears to be at line: print @db

  • hi

    thx for ur information.highly appreciatable.

    thx

    sreejith

    MCAD

  • Does this script have to be run within Query Analyser?

  • YEs this script is intended to be executed in Query Analyzer

    "-=Still Learning=-"

    Lester Policarpio

  • I replaced the path/directory as addvised.

    Running this script in query analyzer got this error:

    Msg 213, Level 16, State 7, Line 1

    Insert Error: Column name or number of supplied values does not match table definition.

    Msg 3013, Level 16, State 1, Line 1

    RESTORE FILELIST is terminating abnormally.

    Please help!

    GT

  • Does your backup filename with this kind of format??

    DBName_db_YYYYMMDDHHMM.BAK??

    "-=Still Learning=-"

    Lester Policarpio

  • Hi

    Would it be possible to alter the script so the filename format could be specified in the script ?

    regards

    Lars Kohsel

  • Yes it can be but part of the script will need to be reconstructed

    "-=Still Learning=-"

    Lester Policarpio

  • in your script you had

    - Not tested for multiple ndfs (currently working for this 1)

    listed as a limitation - have you progressed with this at all?

    -- Cory

  • Posted the updated script which accept backup files with multiple ndfs im just waiting for the site confirmation for this. After running the script please tell me if there were bugs so that i can correct and adjust the error/s. Enjoy 😀

    "-=Still Learning=-"

    Lester Policarpio

  • Hello!

    Is it possible to have the new script, which takes ndfs and perform some testing on it before the site confirmation?

    Thanks

    gtossa

  • The updated script is already up and running 😀

    "-=Still Learning=-"

    Lester Policarpio

  • My Database files have the correct format and I get the error while trying to use your script?

    Msg 213, Level 16, State 7, Line 1

    Insert Error: Column name or number of supplied values does not match table definition.

    Msg 3013, Level 16, State 1, Line 1

    Is it possible to use sp_MSforeachdb?

  • PM'ed you but you didn't asnwer ;). what do you want to attain by using sp_msforeachdb?? I also did some error checking and found out that in other cases, using RESTORE HEADERONLY in the backup file may produce 1 or more results that can lead to a script error anyways i'll update the script to prevent this error. About your problem maybe if you can give me a little bit of information more i can detect the problem you are facing 🙂

    "-=Still Learning=-"

    Lester Policarpio

Viewing 15 posts - 1 through 15 (of 79 total)

You must be logged in to reply to this topic. Login to reply