Why does exporting data from SSMS fail with the error "Login failed for user"

Jim Carlson 0 Reputation points
2023-06-22T20:47:18.4766667+00:00

SSMS connected to my Azure SQL database. All is well except for getting an error trying to export data using the SQL Server Import and Export Wizard.

Azure SQL Database
{count} votes

2 answers

Sort by: Most helpful
  1. Olaf Helper 47,441 Reputation points
    2023-06-23T05:28:48.0033333+00:00

    "Login failed for user"

    You get the error message, because you entered wrong credentials!? Sorry, with that less informations, I can't guess something else.

    I guess connecting SSMS with the same credentials works?

    0 comments No comments

  2. RahulRandive 10,486 Reputation points Volunteer Moderator
    2023-06-23T11:11:57.3833333+00:00

    Hi @Jim Carlson

    The error "Login failed for user" when exporting data from SQL Server Management Studio (SSMS) to an Azure SQL database can occur due to various reasons. In this case, it is likely that the login credentials provided to SSMS are incorrect or the user does not have the necessary permissions to perform the export operation. Here are some steps you can take to troubleshoot and resolve this issue: 

    1. Verify the login credentials: Ensure that the login credentials provided to SSMS are correct and have sufficient permissions to perform the export operation. You can check the login credentials by connecting to the Azure SQL database using SSMS and verifying that you can perform other operations, such as querying the database. 
    2. Check the firewall settings: Ensure that the firewall settings for the Azure SQL database allow connections from the IP address of the machine running SSMS. You can check and modify the firewall settings in the Azure portal by navigating to the Azure SQL database resource and selecting the "Firewalls and virtual networks" option.

     Additionally, you can try exporting data using SQL Package

    You can find detailed steps and information in the following blog: "Using SQLPackage: How to Import or Export SQL Server and Azure SQL DB."

    https://techcommunity.microsoft.com/t5/azure-database-support-blog/using-sqlpackage-to-import-or-export-sql-server-and-azure-sql-db/ba-p/368861

    Please let us know if you have any question or face any difficulties while exporting the database using package.

    Thank you!


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.