views:

4432

answers:

4

We have moved a database from SQL 2000 to a new SQL 2005 that is used with an intranet page to display and update data. We are now unable to login using the sa account as the settings for the page used the old login password and appears to have locked the sa account.

I guess using the sa account for this page was not such a great idea but still that does not help as we can not login to create a new one.

Is there a way to unlock the sa account without being able to login as sa?

+1  A: 

If you have administrative privileges, you can "unharden" SQL to allow sa usage through the "SQL Server Surface Area Configuration" tool. You'll also want to enable SQL logins, in addition to Windows only logins...

AviD
SQL login are enabled, needed to login to SQL Management Studio on the Server using Windows authentication, Thanks
Swinders
+4  A: 

If your system was setup with mixed access, you should be able to logon with an administrator's windows password. Then you could change the password. You can actually do this with any administrator account.

mson
That's the answer, we use SQL authentication and use SQL Management Studio remotely so we always locked out. Only Windows account with access is the local admin so logged onto the server as local admin and could unlock the account. Thanks
Swinders
A: 

We could only login using Windows authentication by being on the actual server. Once we had worked this out we run the command:

ALTER LOGIN sa WITH PASSWORD = 'your_password_here' UNLOCK

in SQL management studio, corrected the login password in the web.config file and everything works.

Turns out that password policies are enforceable on SQL Server 2005 so repeated incorrect logins locked out the account.

Swinders
A: 

Thanks a lot, Swinders. It worked for me.