Mssql driver update (#2610)

* Switching driver from mssql to sqlserver
* Adding explicit database to sp_msloginmappings call
This commit is contained in:
Chris Hoffman
2017-04-18 17:49:59 -04:00
committed by GitHub
parent 8efdae67e5
commit 6b55ab5db0
2 changed files with 2 additions and 2 deletions

View File

@@ -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
}

View File

@@ -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
}