Technological Guide.

Change sa password for SQL Server Express

Tuesday, May 12th, 2009

While installing Visual Studio 2005, it shows like SQL Server 2005 Express edition also installing but you can’t access it. Actually SQL Server 2005 Express edition will be installed on the pc as an instance but it wont appear in the programs list to access. Inorder to access it, we must need a Management Studio express to access and use SQL Server 2005 Express which is enough for medium scale applications. You can download it from here.

Once you install Management Studio express, you can connect to the SQL Server 2005 Express database using windows authentication mode only which is the default connectivity set by the Visual Studio 2005 installer. Inorder to use SQL Authentication mode, you need to configure the SQL Server 2005 Express to work for Mixed Authentication mode (Windows Authentication & SQL Authentication). You can do it by connecting to the SQL Server 2005 Express instance in Windows Authentication mode and configuring as follows.

  1. Right click on the server instance in the object explorer (left side) and click properties
  2. You can see Properties screen for the SQL Server 2005 Express isntance, select Security Option from the “Select a Page” (left side) which looks as follows which shows Windows Authentication Mode as the default
  3. You change the Server Authentication mode to Mixed Authentication (SQL Server and Windows Authentication mode) and click OK to close the properties window.
  4. Now drill down to Security from the Object Explorer and drill down Logins
  5. You can see the list of users registered in the SQL Server 2005 Express instance to access from which you right click on the user sa and click Properties which looks as follows
  6. By Default password for the user sa will be kept null when SQL Server 2005 Express is installed by Visual Studio 2005. Even though the password is null it’ll be displayed like ********* in the above screen. Change the password to your desired in both Password & Confirm Password text boxes and click OK.
  7. You can achieve the above password changing by executing the stored procedure as shown below.
  8. Now you disconnect, close the SQL Server Management Studio Express and you open and connect to SQL Server 2005 Express using SQL Server Authentication mode with your own password for the sa account.

You can use this change password method for SQL Server 2000, SQL Server 2005 provided sufficient privileges are assigned for the windows account you use.