Saturday, September 14, 2013

SA password change

http://msdn.microsoft.com/en-us/library/dd207004.aspx

http://blog.sqlauthority.com/2009/08/04/sql-server-forgot-the-password-of-username-sa/
http://blogs.msdn.com/b/raulga/archive/2007/07/12/disaster-recovery-what-to-do-when-the-sa-account-password-is-lost-in-sql-server-2005.aspx


or

http://www.richnetapps.com/forgot_or_lost_sql_server_sa_password_1/

Here’s a neat thing to remember if you’re using MSSQL:
To change the “sa” password, login to your computer using an administrator account. Open your SQL Server and log in using Windows Authentication. Open a new query window and type in the following command:
sp_password @new = 'new_password', @loginame = 'sa'
After that go to section Security –> Logins –> double click “sa” or choose properties. Go to “Status” and check to see if “Login:” is enabled. If not, enable it.


or


osql -E -S .\SQLEXPRESS exec sp_password @new='changeme', @loginame='sa'
go
alter login sa enable
go
exit


Create new user with Sysadmi in Single user mode:
-------------------------------------------------
EXEC sp_addsrvrolemember ‘Domain\User_Name’, ‘sysadmin’;
GO

No comments:

Post a Comment