From f930705ed26c6653ad260f36f7242124ca3b2c55 Mon Sep 17 00:00:00 2001 From: Kedar Kale Date: Wed, 6 Mar 2019 15:45:41 +0530 Subject: [PATCH] Update mssql.go query will run on the database passed as the parameter instead of the master database --- physical/mssql/mssql.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/physical/mssql/mssql.go b/physical/mssql/mssql.go index d0029dd16..5e34081b5 100644 --- a/physical/mssql/mssql.go +++ b/physical/mssql/mssql.go @@ -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: