INFORMATICS

The Best

Change SQL Server Password Using SQL Script

Change SQL Server Password Using SQL Script

  1. Open the SQL Server Management Studio.
  2. Open a New Query.
  3. Copy, paste, and execute the following:

    GO
    ALTER LOGIN [sa] WITH DEFAULT_DATABASE=[master]
    GO
    USE [master]
    GO
    ALTER LOGIN [sa] WITH PASSWORD=N'NewPassword' MUST_CHANGE
    GO

    where NewPassword is the password you wish to use for the sa account.

Search