microsoft / microsoft/sql-server-samples

Login failed on export

Open
#181 0 comments 0 reactions 1 assignee View on GitHub

@perrysk-msft is already working on this.

Since Mar 30, 2017.

Dominant language
PowerShell
Stars
11.2k
Forks
9.1k
Avg merge
2d 7h
Merged PRs (30d)
14

Description

Error message is:

Unable to reconnect to database: Cannot open database "DATABASENAME_2017-02-02_18:31.02" requested by the login. The login failed.
Login failed for user 'USERNAME'.

Cannot open database "DATABASENAME_2017-02-02_18:31.02" requested by the login. The login failed.
Login failed for user 'USERNAME'.

The user credentials are being set in this line:
$serverCred = Get-AutomationPSCredential -Name 'dbBackupsUser';

And the dbBackupsUser credential asset is set with the username and password that our account admin uses to log into the database (with SSMS or similar). The really screwy thing is that if I stop the process before it attempts an export and then just run the section of the script that starts the export, it's more than happy to proceed. This is only an issue when I'm running the full script, and it just finished copying the database.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.