From 6b55ab5db0b3e07b49c5aefe6d98242ae7c3c48d Mon Sep 17 00:00:00 2001 From: Chris Hoffman Date: Tue, 18 Apr 2017 17:49:59 -0400 Subject: [PATCH] Mssql driver update (#2610) * Switching driver from mssql to sqlserver * Adding explicit database to sp_msloginmappings call --- builtin/logical/mssql/backend.go | 2 +- builtin/logical/mssql/secret_creds.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/builtin/logical/mssql/backend.go b/builtin/logical/mssql/backend.go index 2a7689f17f..61afe75d9c 100644 --- a/builtin/logical/mssql/backend.go +++ b/builtin/logical/mssql/backend.go @@ -78,7 +78,7 @@ func (b *backend) DB(s logical.Storage) (*sql.DB, error) { } connString := connConfig.ConnectionString - db, err := sql.Open("mssql", connString) + db, err := sql.Open("sqlserver", connString) if err != nil { return nil, err } diff --git a/builtin/logical/mssql/secret_creds.go b/builtin/logical/mssql/secret_creds.go index 9e7048ab5f..b870c59a90 100644 --- a/builtin/logical/mssql/secret_creds.go +++ b/builtin/logical/mssql/secret_creds.go @@ -102,7 +102,7 @@ func (b *backend) secretCredsRevoke( // we need to drop the database users before we can drop the login and the role // This isn't done in a transaction because even if we fail along the way, // we want to remove as much access as possible - stmt, err := db.Prepare(fmt.Sprintf("EXEC sp_msloginmappings '%s';", username)) + stmt, err := db.Prepare(fmt.Sprintf("EXEC master.dbo.sp_msloginmappings '%s';", username)) if err != nil { return nil, err }