Update mssql.go

query will run on the database passed as the parameter instead of the master database
This commit is contained in:
Kedar Kale 2019-03-06 15:45:41 +05:30
parent 4ea7f8afa6
commit f930705ed2
1 changed files with 1 additions and 1 deletions

View File

@ -128,7 +128,7 @@ func NewMSSQLBackend(conf map[string]string, logger log.Logger) (physical.Backen
}
var num int
err = db.QueryRow("SELECT 1 FROM sys.schemas WHERE name = '" + schema + "'").Scan(&num)
err = db.QueryRow("SELECT 1 FROM " + database + ".sys.schemas WHERE name = '" + schema + "'").Scan(&num)
switch {
case err == sql.ErrNoRows: