These documentation articles
and
Tell us how to restore individual databases. I want to restore all databases in the file list. Is there a way to do this programmatically from within the sqlcmd
without involving bash?
1 Answer 1
Based on what you want I would do the following:
- Create two files -
List.txt
(with the list of DBs you want to restore) andDBRestore.bat
with sqlcmd command to run a stored procedure 'DBRestore' insideSQL Server
- Create a stored procedure 'DBRestore' which loads into
SQL Server
temp table the list from theLIST.txt
and processes it - reads DB name one by one and restores them
answered Sep 13, 2019 at 7:58
lang-sql
pwsh
in this instance. I'm running on Debian and hoping for a SQL-only solution, if one exists. In other wordspwsh
isn't really any better than bash.