SQL Server recognizes two modes of security:
- Windows Authentication
- SQL Server AND Windows Authentication
If you want to enable SQL Server Authentication on already installed database to allow custom username and password then you have to -
- Enable SQL Server Authentication
- Create a new user account OR use existing
sa user account
- Set account password
Enable SQL Server Authentication Mode -
- In SQL Server Management Studio Object Explorer, right-click the
server, and then click Properties.
- On the Security page, under Server authentication, select the new
server authentication mode, and then click OK.
- In the SQL Server Management Studio dialog box, click OK to acknowledge the requirement to restart SQL Server.
- In Object Explorer, right-click your server, and then click Restart. If SQL Server Agent is running, it must also be restarted.
To Create New Login ID - Refer Create a Login
Disable Windows Authentication Login for BUILTIN Accounts -
Once you are logged in as sa (system administrator) with password (remember password as you are going to disable Windows Authentication for Default Logins), follow below steps -
- Open SQL Server Management Studio
- Expand the nodes to reveal your SQL Server instance
- Expand the
Security node and expand Logins
- Right-click the
BUILTIN\Administraors OR BUILTIN\Users and select Properties
- Goto
Status from left pane.
- Check
Disabled under Login
No one from the Administrators group will be able to access your SQL Server now.
Referred MSDN Thread.
EDIT:
To Use Existing Login account sa -
ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '<enterStrongPasswordHere>' ;
GO
Connection String -
Server=SERVER\SERVER_INSTANCE;Database=Restaurant;User Id=sa;
Password=password;
Refer - Connection Strings for Sql Server 2005
I would recommend to create a new account other than sa and set its password.