cancel
Showing results for 
Search instead for 
Did you mean: 

how to create a bch file to restore SQL Server

littleboy124
Level 3

Hi guys

Recently I am trying to  write a script to restore SQL Server database automatically.

And then I find  a way to create the bch file in  https://www.veritas.com/content/support/en_US/article.100016506

But the script will be  complex to work by  creating bch file manually.I want to figured out whether there is a command line to create it 

Looking forward to your reply,thanks inadvance.

1 ACCEPTED SOLUTION

Accepted Solutions

StefanosM
Level 6
Partner    VIP    Accredited Certified

No, there is not.
You have to build the bch script line by line.

As I told you before, the best way to do it is to create the bch once, using the GUI, and change everything that needs to change using an editor (ex. the new database name and paths).

Then, using the bplist, you can find the SQL backup image, as described in the technote (hint: use find or grep for windows command), and place it at the correct bch line using sed (there is a sed for Windows).

View solution in original post

2 REPLIES 2

StefanosM
Level 6
Partner    VIP    Accredited Certified

No, there is not.
You have to build the bch script line by line.

As I told you before, the best way to do it is to create the bch once, using the GUI, and change everything that needs to change using an editor (ex. the new database name and paths).

Then, using the bplist, you can find the SQL backup image, as described in the technote (hint: use find or grep for windows command), and place it at the correct bch line using sed (there is a sed for Windows).

Thanks for your reply.

It is a little pity(lol),but your perfocessionalism makes me impressed.

Thanks again