Sql-server – SA user password for software which automatically installs SQL Server 2005

sql serversql-server-2005

I am testing a software which requires SQL Server 2005 for storing the data. The SQL Server 2005 database is automatically installed when I installed the software. During the software installation I didn't encounter any screen to configure the SQL Server 2005 database so I am assuming the configuration is done by the software installer.

I can reset the password for the sa but theoretically it would stop the application from working. Can anyone push me in a direction by which I can access the database with a client?

Best Answer

With SQL Server 2005, you have at least a couple of options

  1. run sqlprov.exe as local admin which allows you to add domain accounts to the sysadmin role

  2. stop SQL Server and start in single user mode with the parameter -m and use SQLCMD or OSQL to add your domain account to the sysadmin role (EXEC sp_addsrvrolemember 'MyDatabase\MyNTUserName', 'sysadmin';). You can also create a new SQL Server login and add it to the sysadmin role from the same SQLCMD prompt.