Answer the question
In order to leave comments, you need to log in
MS SQL why did the query time out?
Hello comrades!
I took care of writing a Power Shell script to backup several databases from MS SQL.
$Server = "localhost"
$BaseName = "master"
$BaseLogin = "user"
$BasePassw = "password"
$connection = New-Object -com "ADODB.Connection"
$ConnectionString = "Provider=SQLOLEDB.1;
Data Source=$Server;
Initial Catalog=$BaseName;
User ID=$BaseLogin;
Password=$BasePassw;
Connection Timeout=0;"
$connection.Open($ConnectionString)
$connection.Execute("BACKUP DATABASE [db_name] TO DISK = 'd:\bak\db_name.sql' WITH INIT, NOFORMAT, SKIP, NOUNLOAD")
$connection.Close()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question