Can't connect to SQL Server using 'sa' account, what I'm missing?Granting rights to the sa account using osqlGranting rights to the sa account using osqlCan't connect to SQL serverCan not connect to SQL server with SQL Authentication. But can using Windows AuthenticationMS SQL Server 2008 sa account locked out and Windows Authentication login is greyed outConnect to SQL Server from web application doesn't work?Can't Connect to (local) databaseconnect to SQL Server 2008 r2Set password for SQL Server 2008 R2 AccountUnable to connect to SQL Server 2012 Enterprise local instanceConnecting to SQL Server outside the domain with SQL Authentication

Can more than one instance of Bend Luck be applied to the same roll by multiple Wild Magic sorcerers?

In Dutch history two people are referred to as "William III"; are there any more cases where this happens?

Divisor Rich and Poor Numbers

Lock out of Oracle based on Windows username

Why does the setUID bit work inconsistently?

Should all adjustments be random effects in a mixed linear effect?

Combining two Lorentz boosts

Have the writers and actors of GOT responded to its poor reception?

Can the Gate spell draw a creature larger that 20 feet in every dimension through the portal it creates?

What should I wear to go and sign an employment contract?

Good examples of "two is easy, three is hard" in computational sciences

What do you call bracelets you wear around the legs?

Why are stats in Angband written as 18/** instead of 19, 20...?

Does the usage of mathematical symbols work differently in books than in theses?

Error when running ((x++)) as root

Using `printf` to print variable containing `%` percent sign results in "bash: printf: `p': invalid format character"

Shortest amud or daf in Shas?

how to create an executable file for an AppleScript?

How come Arya Stark wasn't hurt by this in Game of Thrones Season 8 Episode 5?

Cycling to work - 30mile return

Why didn't Daenerys' advisers suggest assassinating Cersei?

Can an airline pilot be prosecuted for killing an unruly passenger who could not be physically restrained?

Windows reverting changes made by Linux to FAT32 partion

Is it possible to determine from only a photo of a cityscape whether it was taken close with wide angle or from a distance with zoom?



Can't connect to SQL Server using 'sa' account, what I'm missing?


Granting rights to the sa account using osqlGranting rights to the sa account using osqlCan't connect to SQL serverCan not connect to SQL server with SQL Authentication. But can using Windows AuthenticationMS SQL Server 2008 sa account locked out and Windows Authentication login is greyed outConnect to SQL Server from web application doesn't work?Can't Connect to (local) databaseconnect to SQL Server 2008 r2Set password for SQL Server 2008 R2 AccountUnable to connect to SQL Server 2012 Enterprise local instanceConnecting to SQL Server outside the domain with SQL Authentication






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








18















I'm trying to log in to a SQL Server 2005 Express instance using the following command:



osql -S .INSTANCE -U sa -P password


I get the error: Login failed for user 'sa'.



I can connect just fine using the -E switch. I must add that it's been working for months. I think someone changed something but I cannot figure out what is it.



This is what I tried:




  • Login using Windows authentication and changing the sa password:



    sp_password NULL, newpassword, 'sa'




  • Enabling 'sa' login:



    ALTER LOGIN sa ENABLE ;
    GO
    ALTER LOGIN sa WITH PASSWORD = 'newpassword' ;
    GO



  • Checked the Windows Registry to ensure that mixed authentication is enabled. The value was correct: LoginMode=2


What else should I check? Thanks in advance.



ADDITIONAL INFO:



This is a Windows 2003 Server. They have some password policies enabled, I remember that I needed to change the default 'sa' password my application uses when it installs SQL Server to another one more complex.



I'm connecting using VNC, so I can't really use SSMS



My application can connect using another SQL Server login, but no 'sa'



Finally, if we don't find a solution I will remove this instance and install it again, but I'd really like to find out what's the problem. Just in case it happens again and just for plain curiosity.










share|improve this question






























    18















    I'm trying to log in to a SQL Server 2005 Express instance using the following command:



    osql -S .INSTANCE -U sa -P password


    I get the error: Login failed for user 'sa'.



    I can connect just fine using the -E switch. I must add that it's been working for months. I think someone changed something but I cannot figure out what is it.



    This is what I tried:




    • Login using Windows authentication and changing the sa password:



      sp_password NULL, newpassword, 'sa'




    • Enabling 'sa' login:



      ALTER LOGIN sa ENABLE ;
      GO
      ALTER LOGIN sa WITH PASSWORD = 'newpassword' ;
      GO



    • Checked the Windows Registry to ensure that mixed authentication is enabled. The value was correct: LoginMode=2


    What else should I check? Thanks in advance.



    ADDITIONAL INFO:



    This is a Windows 2003 Server. They have some password policies enabled, I remember that I needed to change the default 'sa' password my application uses when it installs SQL Server to another one more complex.



    I'm connecting using VNC, so I can't really use SSMS



    My application can connect using another SQL Server login, but no 'sa'



    Finally, if we don't find a solution I will remove this instance and install it again, but I'd really like to find out what's the problem. Just in case it happens again and just for plain curiosity.










    share|improve this question


























      18












      18








      18


      4






      I'm trying to log in to a SQL Server 2005 Express instance using the following command:



      osql -S .INSTANCE -U sa -P password


      I get the error: Login failed for user 'sa'.



      I can connect just fine using the -E switch. I must add that it's been working for months. I think someone changed something but I cannot figure out what is it.



      This is what I tried:




      • Login using Windows authentication and changing the sa password:



        sp_password NULL, newpassword, 'sa'




      • Enabling 'sa' login:



        ALTER LOGIN sa ENABLE ;
        GO
        ALTER LOGIN sa WITH PASSWORD = 'newpassword' ;
        GO



      • Checked the Windows Registry to ensure that mixed authentication is enabled. The value was correct: LoginMode=2


      What else should I check? Thanks in advance.



      ADDITIONAL INFO:



      This is a Windows 2003 Server. They have some password policies enabled, I remember that I needed to change the default 'sa' password my application uses when it installs SQL Server to another one more complex.



      I'm connecting using VNC, so I can't really use SSMS



      My application can connect using another SQL Server login, but no 'sa'



      Finally, if we don't find a solution I will remove this instance and install it again, but I'd really like to find out what's the problem. Just in case it happens again and just for plain curiosity.










      share|improve this question
















      I'm trying to log in to a SQL Server 2005 Express instance using the following command:



      osql -S .INSTANCE -U sa -P password


      I get the error: Login failed for user 'sa'.



      I can connect just fine using the -E switch. I must add that it's been working for months. I think someone changed something but I cannot figure out what is it.



      This is what I tried:




      • Login using Windows authentication and changing the sa password:



        sp_password NULL, newpassword, 'sa'




      • Enabling 'sa' login:



        ALTER LOGIN sa ENABLE ;
        GO
        ALTER LOGIN sa WITH PASSWORD = 'newpassword' ;
        GO



      • Checked the Windows Registry to ensure that mixed authentication is enabled. The value was correct: LoginMode=2


      What else should I check? Thanks in advance.



      ADDITIONAL INFO:



      This is a Windows 2003 Server. They have some password policies enabled, I remember that I needed to change the default 'sa' password my application uses when it installs SQL Server to another one more complex.



      I'm connecting using VNC, so I can't really use SSMS



      My application can connect using another SQL Server login, but no 'sa'



      Finally, if we don't find a solution I will remove this instance and install it again, but I'd really like to find out what's the problem. Just in case it happens again and just for plain curiosity.







      sql-server






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Jul 3 '09 at 15:50







      JAG

















      asked Jul 3 '09 at 11:07









      JAGJAG

      6492715




      6492715




















          9 Answers
          9






          active

          oldest

          votes


















          19














          Like @SpaceManSpiff said, don't forget to check if Mixed mode is enabled. Someone changed that setting for me and I had the same problem. Here is how to solve it:



          1. Login to the MSSQL Server Management Studio with Windows Authentication.

          2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

          3. Under the Server Properties, select a page of "Security".

          4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok.
            MSSQL Server Management Database properties

          5. Restart the SQL Services and then try to login with 'sa' details.

          Source:
          http://forums.eukhost.com/f15/login-failed-user-sa-microsoft-sql-server-error-18456-a-12544/






          share|improve this answer






























            12














            Ok, I've been able to figure out what was happening (kind of) and got a workaround.



            It seems that one week ago they were playing with the Windows Security policy. They were adding/removing permissions but they can't give me exactly what they did because they really didn't know (ouch!).



            Anyway, I connected using Windows authentication (-E switch) and run the following query:



            ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF
            GO
            ALTER LOGIN [sa] ENABLE
            GO


            The key here is CHECK_POLICY=OFF. That made the trick. I hope this will make 'sa' immune to future changes in their domain setup.



            Thanks for all your suggestions.






            share|improve this answer






























              6














              Things to check



              Password on SA account



              Mixed mode enabled



              Is the SA account disabled?



              Create another SQL account and try it (since you can get in with -E you dhould be able to do this)



              Test using an ODBC connection, you can create this connection to see if the SA works



              Oh and the always catch all in windows, reboot (seriously, this helps my test SQL server after I've done stuff to it)






              share|improve this answer






























                1














                I had that problem some years ago after installing a Windows ServicePack (no SQLServer Update, but Windows), the SQLServer refused connections, until the SQLServer ServicePack was installed also! I found a message in the eventlog after some hours.



                I think they did this, because they knew there is a big security hole and wanted to force all admins to install the pack. However, since it is some time ago, I don't no the exact versions and so on. I would recommend, you double check you event log and install all/newest service packs.






                share|improve this answer























                • This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                  – JAG
                  Jul 3 '09 at 18:58











                • Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                  – JAG
                  Jul 6 '09 at 9:57


















                0














                Assuming you have Management Studio or Management Studio Express installed, can you connect the Management Studio to the instance using sa?



                JR






                share|improve this answer


















                • 1





                  SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                  – JAG
                  Jul 3 '09 at 11:25











                • If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                  – John Rennie
                  Jul 3 '09 at 14:43


















                0














                Did you make sure that you restarted the SQL Server service after you made the registry change?






                share|improve this answer























                • Didn't need to change it because it had the correct value.

                  – JAG
                  Jul 3 '09 at 12:33


















                0














                Did somebody remove the database which was the default database for "sa"?



                If that is the problem, try



                EXEC sp_defaultdb 'sa', 'New default database'





                share|improve this answer























                • In theory, there is only one database and it exists. I didn't run that command though.

                  – JAG
                  Jul 3 '09 at 12:34











                • Normally it's 'master'. But I think that's not the problem...

                  – splattne
                  Jul 3 '09 at 13:00











                • I've just tried it but made no difference. Thanks anyway.

                  – JAG
                  Jul 6 '09 at 9:44


















                0














                If you are installing SQL Express 2014, you'll have to do a few things to resolve this error if you try logging in with the [sa] account.



                1. The "sa" account will become disabled. So you'll need to toggle the account from disabled to enabled under the status section of the account.


                2. The server must have windows and sql server authentication enabled. By default, only windows authentication is enabled.


                3. Reset the password. (see code below; ServerFault has a bug where code doesn't show up the same when using an ordered list as of 6/8/2016)


                4. Restart the Windows Service for SQL Server


                =========



                ALTER LOGIN sa WITH PASSWORD='password', CHECK_POLICY=OFF;
                ALTER LOGIN [sa] ENABLE;





                share|improve this answer
































                  0














                  Sometimes login is disabled due to many incorrect passwords or any policy violation. So what we can do is just log in with window authentication, change the password and enable login again.



                  Log into the database with Windows Authentication



                  Run Query:



                  ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF 
                  GO
                  ALTER LOGIN [sa] ENABLE
                  GO


                  Use of CHECK_POLICY is required as it specifies that the Windows password policies of the computer on which SQL Server is running should be enforced on this login. The default is ON when we make OFF it will change the password without any difficulties. Later you can ON



                  NOTE: What I have observed that when CHECK_POLICY is on the GUI SSME solutions for changing password won't work every time. I don't the reason behind but that I have observed.






                  share|improve this answer

























                    Your Answer








                    StackExchange.ready(function()
                    var channelOptions =
                    tags: "".split(" "),
                    id: "2"
                    ;
                    initTagRenderer("".split(" "), "".split(" "), channelOptions);

                    StackExchange.using("externalEditor", function()
                    // Have to fire editor after snippets, if snippets enabled
                    if (StackExchange.settings.snippets.snippetsEnabled)
                    StackExchange.using("snippets", function()
                    createEditor();
                    );

                    else
                    createEditor();

                    );

                    function createEditor()
                    StackExchange.prepareEditor(
                    heartbeatType: 'answer',
                    autoActivateHeartbeat: false,
                    convertImagesToLinks: true,
                    noModals: true,
                    showLowRepImageUploadWarning: true,
                    reputationToPostImages: 10,
                    bindNavPrevention: true,
                    postfix: "",
                    imageUploader:
                    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                    allowUrls: true
                    ,
                    onDemand: true,
                    discardSelector: ".discard-answer"
                    ,immediatelyShowMarkdownHelp:true
                    );



                    );













                    draft saved

                    draft discarded


















                    StackExchange.ready(
                    function ()
                    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f35505%2fcant-connect-to-sql-server-using-sa-account-what-im-missing%23new-answer', 'question_page');

                    );

                    Post as a guest















                    Required, but never shown

























                    9 Answers
                    9






                    active

                    oldest

                    votes








                    9 Answers
                    9






                    active

                    oldest

                    votes









                    active

                    oldest

                    votes






                    active

                    oldest

                    votes









                    19














                    Like @SpaceManSpiff said, don't forget to check if Mixed mode is enabled. Someone changed that setting for me and I had the same problem. Here is how to solve it:



                    1. Login to the MSSQL Server Management Studio with Windows Authentication.

                    2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

                    3. Under the Server Properties, select a page of "Security".

                    4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok.
                      MSSQL Server Management Database properties

                    5. Restart the SQL Services and then try to login with 'sa' details.

                    Source:
                    http://forums.eukhost.com/f15/login-failed-user-sa-microsoft-sql-server-error-18456-a-12544/






                    share|improve this answer



























                      19














                      Like @SpaceManSpiff said, don't forget to check if Mixed mode is enabled. Someone changed that setting for me and I had the same problem. Here is how to solve it:



                      1. Login to the MSSQL Server Management Studio with Windows Authentication.

                      2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

                      3. Under the Server Properties, select a page of "Security".

                      4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok.
                        MSSQL Server Management Database properties

                      5. Restart the SQL Services and then try to login with 'sa' details.

                      Source:
                      http://forums.eukhost.com/f15/login-failed-user-sa-microsoft-sql-server-error-18456-a-12544/






                      share|improve this answer

























                        19












                        19








                        19







                        Like @SpaceManSpiff said, don't forget to check if Mixed mode is enabled. Someone changed that setting for me and I had the same problem. Here is how to solve it:



                        1. Login to the MSSQL Server Management Studio with Windows Authentication.

                        2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

                        3. Under the Server Properties, select a page of "Security".

                        4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok.
                          MSSQL Server Management Database properties

                        5. Restart the SQL Services and then try to login with 'sa' details.

                        Source:
                        http://forums.eukhost.com/f15/login-failed-user-sa-microsoft-sql-server-error-18456-a-12544/






                        share|improve this answer













                        Like @SpaceManSpiff said, don't forget to check if Mixed mode is enabled. Someone changed that setting for me and I had the same problem. Here is how to solve it:



                        1. Login to the MSSQL Server Management Studio with Windows Authentication.

                        2. In SQL Server Management Studio Object Explorer, right-click the server, and then click Properties.

                        3. Under the Server Properties, select a page of "Security".

                        4. Select the Server authentication as "SQL Server and Windows Authentication mode" and click Ok.
                          MSSQL Server Management Database properties

                        5. Restart the SQL Services and then try to login with 'sa' details.

                        Source:
                        http://forums.eukhost.com/f15/login-failed-user-sa-microsoft-sql-server-error-18456-a-12544/







                        share|improve this answer












                        share|improve this answer



                        share|improve this answer










                        answered Jun 18 '12 at 18:11









                        emmanuelemmanuel

                        31624




                        31624























                            12














                            Ok, I've been able to figure out what was happening (kind of) and got a workaround.



                            It seems that one week ago they were playing with the Windows Security policy. They were adding/removing permissions but they can't give me exactly what they did because they really didn't know (ouch!).



                            Anyway, I connected using Windows authentication (-E switch) and run the following query:



                            ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF
                            GO
                            ALTER LOGIN [sa] ENABLE
                            GO


                            The key here is CHECK_POLICY=OFF. That made the trick. I hope this will make 'sa' immune to future changes in their domain setup.



                            Thanks for all your suggestions.






                            share|improve this answer



























                              12














                              Ok, I've been able to figure out what was happening (kind of) and got a workaround.



                              It seems that one week ago they were playing with the Windows Security policy. They were adding/removing permissions but they can't give me exactly what they did because they really didn't know (ouch!).



                              Anyway, I connected using Windows authentication (-E switch) and run the following query:



                              ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF
                              GO
                              ALTER LOGIN [sa] ENABLE
                              GO


                              The key here is CHECK_POLICY=OFF. That made the trick. I hope this will make 'sa' immune to future changes in their domain setup.



                              Thanks for all your suggestions.






                              share|improve this answer

























                                12












                                12








                                12







                                Ok, I've been able to figure out what was happening (kind of) and got a workaround.



                                It seems that one week ago they were playing with the Windows Security policy. They were adding/removing permissions but they can't give me exactly what they did because they really didn't know (ouch!).



                                Anyway, I connected using Windows authentication (-E switch) and run the following query:



                                ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF
                                GO
                                ALTER LOGIN [sa] ENABLE
                                GO


                                The key here is CHECK_POLICY=OFF. That made the trick. I hope this will make 'sa' immune to future changes in their domain setup.



                                Thanks for all your suggestions.






                                share|improve this answer













                                Ok, I've been able to figure out what was happening (kind of) and got a workaround.



                                It seems that one week ago they were playing with the Windows Security policy. They were adding/removing permissions but they can't give me exactly what they did because they really didn't know (ouch!).



                                Anyway, I connected using Windows authentication (-E switch) and run the following query:



                                ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF
                                GO
                                ALTER LOGIN [sa] ENABLE
                                GO


                                The key here is CHECK_POLICY=OFF. That made the trick. I hope this will make 'sa' immune to future changes in their domain setup.



                                Thanks for all your suggestions.







                                share|improve this answer












                                share|improve this answer



                                share|improve this answer










                                answered Jul 6 '09 at 9:56









                                JAGJAG

                                6492715




                                6492715





















                                    6














                                    Things to check



                                    Password on SA account



                                    Mixed mode enabled



                                    Is the SA account disabled?



                                    Create another SQL account and try it (since you can get in with -E you dhould be able to do this)



                                    Test using an ODBC connection, you can create this connection to see if the SA works



                                    Oh and the always catch all in windows, reboot (seriously, this helps my test SQL server after I've done stuff to it)






                                    share|improve this answer



























                                      6














                                      Things to check



                                      Password on SA account



                                      Mixed mode enabled



                                      Is the SA account disabled?



                                      Create another SQL account and try it (since you can get in with -E you dhould be able to do this)



                                      Test using an ODBC connection, you can create this connection to see if the SA works



                                      Oh and the always catch all in windows, reboot (seriously, this helps my test SQL server after I've done stuff to it)






                                      share|improve this answer

























                                        6












                                        6








                                        6







                                        Things to check



                                        Password on SA account



                                        Mixed mode enabled



                                        Is the SA account disabled?



                                        Create another SQL account and try it (since you can get in with -E you dhould be able to do this)



                                        Test using an ODBC connection, you can create this connection to see if the SA works



                                        Oh and the always catch all in windows, reboot (seriously, this helps my test SQL server after I've done stuff to it)






                                        share|improve this answer













                                        Things to check



                                        Password on SA account



                                        Mixed mode enabled



                                        Is the SA account disabled?



                                        Create another SQL account and try it (since you can get in with -E you dhould be able to do this)



                                        Test using an ODBC connection, you can create this connection to see if the SA works



                                        Oh and the always catch all in windows, reboot (seriously, this helps my test SQL server after I've done stuff to it)







                                        share|improve this answer












                                        share|improve this answer



                                        share|improve this answer










                                        answered Jul 3 '09 at 16:00









                                        SpaceManSpiffSpaceManSpiff

                                        2,4721519




                                        2,4721519





















                                            1














                                            I had that problem some years ago after installing a Windows ServicePack (no SQLServer Update, but Windows), the SQLServer refused connections, until the SQLServer ServicePack was installed also! I found a message in the eventlog after some hours.



                                            I think they did this, because they knew there is a big security hole and wanted to force all admins to install the pack. However, since it is some time ago, I don't no the exact versions and so on. I would recommend, you double check you event log and install all/newest service packs.






                                            share|improve this answer























                                            • This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                                              – JAG
                                              Jul 3 '09 at 18:58











                                            • Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                                              – JAG
                                              Jul 6 '09 at 9:57















                                            1














                                            I had that problem some years ago after installing a Windows ServicePack (no SQLServer Update, but Windows), the SQLServer refused connections, until the SQLServer ServicePack was installed also! I found a message in the eventlog after some hours.



                                            I think they did this, because they knew there is a big security hole and wanted to force all admins to install the pack. However, since it is some time ago, I don't no the exact versions and so on. I would recommend, you double check you event log and install all/newest service packs.






                                            share|improve this answer























                                            • This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                                              – JAG
                                              Jul 3 '09 at 18:58











                                            • Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                                              – JAG
                                              Jul 6 '09 at 9:57













                                            1












                                            1








                                            1







                                            I had that problem some years ago after installing a Windows ServicePack (no SQLServer Update, but Windows), the SQLServer refused connections, until the SQLServer ServicePack was installed also! I found a message in the eventlog after some hours.



                                            I think they did this, because they knew there is a big security hole and wanted to force all admins to install the pack. However, since it is some time ago, I don't no the exact versions and so on. I would recommend, you double check you event log and install all/newest service packs.






                                            share|improve this answer













                                            I had that problem some years ago after installing a Windows ServicePack (no SQLServer Update, but Windows), the SQLServer refused connections, until the SQLServer ServicePack was installed also! I found a message in the eventlog after some hours.



                                            I think they did this, because they knew there is a big security hole and wanted to force all admins to install the pack. However, since it is some time ago, I don't no the exact versions and so on. I would recommend, you double check you event log and install all/newest service packs.







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Jul 3 '09 at 15:59









                                            Tim BütheTim Büthe

                                            2922416




                                            2922416












                                            • This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                                              – JAG
                                              Jul 3 '09 at 18:58











                                            • Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                                              – JAG
                                              Jul 6 '09 at 9:57

















                                            • This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                                              – JAG
                                              Jul 3 '09 at 18:58











                                            • Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                                              – JAG
                                              Jul 6 '09 at 9:57
















                                            This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                                            – JAG
                                            Jul 3 '09 at 18:58





                                            This looks promising, I'll try it on Monday and report back. Thanks for the suggestion.

                                            – JAG
                                            Jul 3 '09 at 18:58













                                            Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                                            – JAG
                                            Jul 6 '09 at 9:57





                                            Finally I did not try to install the latest Service Pack. See my own 'accepted answer'.

                                            – JAG
                                            Jul 6 '09 at 9:57











                                            0














                                            Assuming you have Management Studio or Management Studio Express installed, can you connect the Management Studio to the instance using sa?



                                            JR






                                            share|improve this answer


















                                            • 1





                                              SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                                              – JAG
                                              Jul 3 '09 at 11:25











                                            • If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                                              – John Rennie
                                              Jul 3 '09 at 14:43















                                            0














                                            Assuming you have Management Studio or Management Studio Express installed, can you connect the Management Studio to the instance using sa?



                                            JR






                                            share|improve this answer


















                                            • 1





                                              SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                                              – JAG
                                              Jul 3 '09 at 11:25











                                            • If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                                              – John Rennie
                                              Jul 3 '09 at 14:43













                                            0












                                            0








                                            0







                                            Assuming you have Management Studio or Management Studio Express installed, can you connect the Management Studio to the instance using sa?



                                            JR






                                            share|improve this answer













                                            Assuming you have Management Studio or Management Studio Express installed, can you connect the Management Studio to the instance using sa?



                                            JR







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Jul 3 '09 at 11:21









                                            John RennieJohn Rennie

                                            7,41811930




                                            7,41811930







                                            • 1





                                              SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                                              – JAG
                                              Jul 3 '09 at 11:25











                                            • If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                                              – John Rennie
                                              Jul 3 '09 at 14:43












                                            • 1





                                              SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                                              – JAG
                                              Jul 3 '09 at 11:25











                                            • If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                                              – John Rennie
                                              Jul 3 '09 at 14:43







                                            1




                                            1





                                            SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                                            – JAG
                                            Jul 3 '09 at 11:25





                                            SSMS is not installed and I'd prefer not to install it if possible. Also, connecting from another computer with SSMS is not an option as this is a customer server. Only the command line tools are available.

                                            – JAG
                                            Jul 3 '09 at 11:25













                                            If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                                            – John Rennie
                                            Jul 3 '09 at 14:43





                                            If you have the Management Studio on another PC, even if it's at the far end of a VPN, you should still be able to connect. The point is to check whether there's something screwy with the server setup, or whether the problem lies with the osql command.

                                            – John Rennie
                                            Jul 3 '09 at 14:43











                                            0














                                            Did you make sure that you restarted the SQL Server service after you made the registry change?






                                            share|improve this answer























                                            • Didn't need to change it because it had the correct value.

                                              – JAG
                                              Jul 3 '09 at 12:33















                                            0














                                            Did you make sure that you restarted the SQL Server service after you made the registry change?






                                            share|improve this answer























                                            • Didn't need to change it because it had the correct value.

                                              – JAG
                                              Jul 3 '09 at 12:33













                                            0












                                            0








                                            0







                                            Did you make sure that you restarted the SQL Server service after you made the registry change?






                                            share|improve this answer













                                            Did you make sure that you restarted the SQL Server service after you made the registry change?







                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Jul 3 '09 at 12:09









                                            David SpillettDavid Spillett

                                            21.3k3161




                                            21.3k3161












                                            • Didn't need to change it because it had the correct value.

                                              – JAG
                                              Jul 3 '09 at 12:33

















                                            • Didn't need to change it because it had the correct value.

                                              – JAG
                                              Jul 3 '09 at 12:33
















                                            Didn't need to change it because it had the correct value.

                                            – JAG
                                            Jul 3 '09 at 12:33





                                            Didn't need to change it because it had the correct value.

                                            – JAG
                                            Jul 3 '09 at 12:33











                                            0














                                            Did somebody remove the database which was the default database for "sa"?



                                            If that is the problem, try



                                            EXEC sp_defaultdb 'sa', 'New default database'





                                            share|improve this answer























                                            • In theory, there is only one database and it exists. I didn't run that command though.

                                              – JAG
                                              Jul 3 '09 at 12:34











                                            • Normally it's 'master'. But I think that's not the problem...

                                              – splattne
                                              Jul 3 '09 at 13:00











                                            • I've just tried it but made no difference. Thanks anyway.

                                              – JAG
                                              Jul 6 '09 at 9:44















                                            0














                                            Did somebody remove the database which was the default database for "sa"?



                                            If that is the problem, try



                                            EXEC sp_defaultdb 'sa', 'New default database'





                                            share|improve this answer























                                            • In theory, there is only one database and it exists. I didn't run that command though.

                                              – JAG
                                              Jul 3 '09 at 12:34











                                            • Normally it's 'master'. But I think that's not the problem...

                                              – splattne
                                              Jul 3 '09 at 13:00











                                            • I've just tried it but made no difference. Thanks anyway.

                                              – JAG
                                              Jul 6 '09 at 9:44













                                            0












                                            0








                                            0







                                            Did somebody remove the database which was the default database for "sa"?



                                            If that is the problem, try



                                            EXEC sp_defaultdb 'sa', 'New default database'





                                            share|improve this answer













                                            Did somebody remove the database which was the default database for "sa"?



                                            If that is the problem, try



                                            EXEC sp_defaultdb 'sa', 'New default database'






                                            share|improve this answer












                                            share|improve this answer



                                            share|improve this answer










                                            answered Jul 3 '09 at 12:32









                                            splattnesplattne

                                            25.8k1892144




                                            25.8k1892144












                                            • In theory, there is only one database and it exists. I didn't run that command though.

                                              – JAG
                                              Jul 3 '09 at 12:34











                                            • Normally it's 'master'. But I think that's not the problem...

                                              – splattne
                                              Jul 3 '09 at 13:00











                                            • I've just tried it but made no difference. Thanks anyway.

                                              – JAG
                                              Jul 6 '09 at 9:44

















                                            • In theory, there is only one database and it exists. I didn't run that command though.

                                              – JAG
                                              Jul 3 '09 at 12:34











                                            • Normally it's 'master'. But I think that's not the problem...

                                              – splattne
                                              Jul 3 '09 at 13:00











                                            • I've just tried it but made no difference. Thanks anyway.

                                              – JAG
                                              Jul 6 '09 at 9:44
















                                            In theory, there is only one database and it exists. I didn't run that command though.

                                            – JAG
                                            Jul 3 '09 at 12:34





                                            In theory, there is only one database and it exists. I didn't run that command though.

                                            – JAG
                                            Jul 3 '09 at 12:34













                                            Normally it's 'master'. But I think that's not the problem...

                                            – splattne
                                            Jul 3 '09 at 13:00





                                            Normally it's 'master'. But I think that's not the problem...

                                            – splattne
                                            Jul 3 '09 at 13:00













                                            I've just tried it but made no difference. Thanks anyway.

                                            – JAG
                                            Jul 6 '09 at 9:44





                                            I've just tried it but made no difference. Thanks anyway.

                                            – JAG
                                            Jul 6 '09 at 9:44











                                            0














                                            If you are installing SQL Express 2014, you'll have to do a few things to resolve this error if you try logging in with the [sa] account.



                                            1. The "sa" account will become disabled. So you'll need to toggle the account from disabled to enabled under the status section of the account.


                                            2. The server must have windows and sql server authentication enabled. By default, only windows authentication is enabled.


                                            3. Reset the password. (see code below; ServerFault has a bug where code doesn't show up the same when using an ordered list as of 6/8/2016)


                                            4. Restart the Windows Service for SQL Server


                                            =========



                                            ALTER LOGIN sa WITH PASSWORD='password', CHECK_POLICY=OFF;
                                            ALTER LOGIN [sa] ENABLE;





                                            share|improve this answer





























                                              0














                                              If you are installing SQL Express 2014, you'll have to do a few things to resolve this error if you try logging in with the [sa] account.



                                              1. The "sa" account will become disabled. So you'll need to toggle the account from disabled to enabled under the status section of the account.


                                              2. The server must have windows and sql server authentication enabled. By default, only windows authentication is enabled.


                                              3. Reset the password. (see code below; ServerFault has a bug where code doesn't show up the same when using an ordered list as of 6/8/2016)


                                              4. Restart the Windows Service for SQL Server


                                              =========



                                              ALTER LOGIN sa WITH PASSWORD='password', CHECK_POLICY=OFF;
                                              ALTER LOGIN [sa] ENABLE;





                                              share|improve this answer



























                                                0












                                                0








                                                0







                                                If you are installing SQL Express 2014, you'll have to do a few things to resolve this error if you try logging in with the [sa] account.



                                                1. The "sa" account will become disabled. So you'll need to toggle the account from disabled to enabled under the status section of the account.


                                                2. The server must have windows and sql server authentication enabled. By default, only windows authentication is enabled.


                                                3. Reset the password. (see code below; ServerFault has a bug where code doesn't show up the same when using an ordered list as of 6/8/2016)


                                                4. Restart the Windows Service for SQL Server


                                                =========



                                                ALTER LOGIN sa WITH PASSWORD='password', CHECK_POLICY=OFF;
                                                ALTER LOGIN [sa] ENABLE;





                                                share|improve this answer















                                                If you are installing SQL Express 2014, you'll have to do a few things to resolve this error if you try logging in with the [sa] account.



                                                1. The "sa" account will become disabled. So you'll need to toggle the account from disabled to enabled under the status section of the account.


                                                2. The server must have windows and sql server authentication enabled. By default, only windows authentication is enabled.


                                                3. Reset the password. (see code below; ServerFault has a bug where code doesn't show up the same when using an ordered list as of 6/8/2016)


                                                4. Restart the Windows Service for SQL Server


                                                =========



                                                ALTER LOGIN sa WITH PASSWORD='password', CHECK_POLICY=OFF;
                                                ALTER LOGIN [sa] ENABLE;






                                                share|improve this answer














                                                share|improve this answer



                                                share|improve this answer








                                                edited Jun 8 '16 at 7:23

























                                                answered Jun 8 '16 at 5:05









                                                MacGyverMacGyver

                                                94452545




                                                94452545





















                                                    0














                                                    Sometimes login is disabled due to many incorrect passwords or any policy violation. So what we can do is just log in with window authentication, change the password and enable login again.



                                                    Log into the database with Windows Authentication



                                                    Run Query:



                                                    ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF 
                                                    GO
                                                    ALTER LOGIN [sa] ENABLE
                                                    GO


                                                    Use of CHECK_POLICY is required as it specifies that the Windows password policies of the computer on which SQL Server is running should be enforced on this login. The default is ON when we make OFF it will change the password without any difficulties. Later you can ON



                                                    NOTE: What I have observed that when CHECK_POLICY is on the GUI SSME solutions for changing password won't work every time. I don't the reason behind but that I have observed.






                                                    share|improve this answer





























                                                      0














                                                      Sometimes login is disabled due to many incorrect passwords or any policy violation. So what we can do is just log in with window authentication, change the password and enable login again.



                                                      Log into the database with Windows Authentication



                                                      Run Query:



                                                      ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF 
                                                      GO
                                                      ALTER LOGIN [sa] ENABLE
                                                      GO


                                                      Use of CHECK_POLICY is required as it specifies that the Windows password policies of the computer on which SQL Server is running should be enforced on this login. The default is ON when we make OFF it will change the password without any difficulties. Later you can ON



                                                      NOTE: What I have observed that when CHECK_POLICY is on the GUI SSME solutions for changing password won't work every time. I don't the reason behind but that I have observed.






                                                      share|improve this answer



























                                                        0












                                                        0








                                                        0







                                                        Sometimes login is disabled due to many incorrect passwords or any policy violation. So what we can do is just log in with window authentication, change the password and enable login again.



                                                        Log into the database with Windows Authentication



                                                        Run Query:



                                                        ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF 
                                                        GO
                                                        ALTER LOGIN [sa] ENABLE
                                                        GO


                                                        Use of CHECK_POLICY is required as it specifies that the Windows password policies of the computer on which SQL Server is running should be enforced on this login. The default is ON when we make OFF it will change the password without any difficulties. Later you can ON



                                                        NOTE: What I have observed that when CHECK_POLICY is on the GUI SSME solutions for changing password won't work every time. I don't the reason behind but that I have observed.






                                                        share|improve this answer















                                                        Sometimes login is disabled due to many incorrect passwords or any policy violation. So what we can do is just log in with window authentication, change the password and enable login again.



                                                        Log into the database with Windows Authentication



                                                        Run Query:



                                                        ALTER LOGIN [sa] WITH PASSWORD='newpassword', CHECK_POLICY=OFF 
                                                        GO
                                                        ALTER LOGIN [sa] ENABLE
                                                        GO


                                                        Use of CHECK_POLICY is required as it specifies that the Windows password policies of the computer on which SQL Server is running should be enforced on this login. The default is ON when we make OFF it will change the password without any difficulties. Later you can ON



                                                        NOTE: What I have observed that when CHECK_POLICY is on the GUI SSME solutions for changing password won't work every time. I don't the reason behind but that I have observed.







                                                        share|improve this answer














                                                        share|improve this answer



                                                        share|improve this answer








                                                        edited May 9 '18 at 7:10

























                                                        answered May 8 '18 at 4:59









                                                        jay pateljay patel

                                                        12




                                                        12



























                                                            draft saved

                                                            draft discarded
















































                                                            Thanks for contributing an answer to Server Fault!


                                                            • Please be sure to answer the question. Provide details and share your research!

                                                            But avoid


                                                            • Asking for help, clarification, or responding to other answers.

                                                            • Making statements based on opinion; back them up with references or personal experience.

                                                            To learn more, see our tips on writing great answers.




                                                            draft saved


                                                            draft discarded














                                                            StackExchange.ready(
                                                            function ()
                                                            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f35505%2fcant-connect-to-sql-server-using-sa-account-what-im-missing%23new-answer', 'question_page');

                                                            );

                                                            Post as a guest















                                                            Required, but never shown





















































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown

































                                                            Required, but never shown














                                                            Required, but never shown












                                                            Required, but never shown







                                                            Required, but never shown







                                                            Popular posts from this blog

                                                            How to write a 12-bar blues melodyI-IV-V blues progressionHow to play the bridges in a standard blues progressionHow does Gdim7 fit in C# minor?question on a certain chord progressionMusicology of Melody12 bar blues, spread rhythm: alternative to 6th chord to avoid finger stretchChord progressions/ Root key/ MelodiesHow to put chords (POP-EDM) under a given lead vocal melody (starting from a good knowledge in music theory)Are there “rules” for improvising with the minor pentatonic scale over 12-bar shuffle?Confusion about blues scale and chords

                                                            What if the end-user didn't have the required library?What is setup.py?What is a clean, pythonic way to have multiple constructors in Python?What does Ruby have that Python doesn't, and vice versa?What is the reason for having '//' in Python?How do I create a namespace package in Python?How to package shared objects that python modules depend on?setuptools vs. distutils: why is distutils still a thing?Navigation in Windows 10 vs code not going to virtualenv library when the same library is installed at user levelPython create package for local usePackaging a project that uses multiple python versionsWhy is permission denied on pip install except for when “--user” is included at end of command?

                                                            Esgonzo ibérico Índice Descrición Distribución Hábitat Ameazas Notas Véxase tamén "Acerca dos nomes dos anfibios e réptiles galegos""Chalcides bedriagai"Chalcides bedriagai en Carrascal, L. M. Salvador, A. (Eds). Enciclopedia virtual de los vertebrados españoles. Museo Nacional de Ciencias Naturales, Madrid. España.Fotos