Search code examples
sql-server-2008authenticationsa

In SQL Server 2008 R2 - why can't I change the sa credentails


I'm using AMAZON cloud with SQL Server 2008 R2 installed. I tried to create a password to sa and saved it. But when I went back to SQL Server (after I closed SQL Server and opened it again) it does not let me enter it with the sa credentials that I sat. (I can gain access using Windows Authentication) , stating

Login failed for user 'sa'. (.Net SqlClient Data Provider)

The error number is 18456. I can go in only with Windows Authentication. How can I set sa properly ? Any Ideas?

Here is the full text:

Cannot connect to [server name].

Login failed for user 'sa'. (.Net SqlClient Data Provider)

Server Name: [server name]
Error Number: 18456
Severity: 14
State: 1
Line Number: 65536


Solution

  • It should have also given you a state code as well; searching the combination will show you exactly what the issue is. Are you sure you enabled mixed mode authentication when installing? This article shows you how to enable it: SQL 2008 R2: Enabling Mixed Mode Authentication

    This code will verify whether it has been configured for mixed mode authentication already:

    SELECT CASE SERVERPROPERTY('IsIntegratedSecurityOnly')   
    WHEN 1 THEN 'Windows Authentication'   
    WHEN 0 THEN 'Windows and SQL Server Authentication'   
    END as [Authentication Mode]