Part 6 - Create the Moodle database and database login
- Open Microsoft SQL Server Management Studio and create a new blank database on the database server. Enter the name for the database on the General page.

- Open the Options page and use all the default settings except:
- Set ANSI NULLS Enabled to true
- Set Quoted Identifiers Enabled to true

- Click the OK button. The new database will be created.
- Create a database user and login.
- Open the Security folder in the Object Explorer and expand the Logins sub-folder.
- Right-click on the Security folder and select New Login. This will open the General page of the Login - New dialog box.

- Enter the Login name that you want Moodle to use when it connects to the database.
- Select the SQL Server authentication radio button and enter a password for the login.
- Select your Moodle database as the Default database.
- Open the User Mappings page and select your Moodle database in the Users mapped to this login section. The login name that you specified on the General page will automatically be pulled through and displayed in the User column.

- Select dbo as the Default Schema.
- Select the following database role memberships in the Database role membership for field:
- db_datareader
- db_datawriter
- db_ddladmin
- the public role will already be selected (and you can't deselect it)
Note:
You must select the db_ddladmin role. Without it the Moodle scripts will not have the correct permissions to access the database objects and you will get Permission Denied errors when you install Moodle.
- Click OK. The database user will be created and mapped to your Moodle database.
Your database is now setup for Moodle. The next step is to install Moodle. But first you should test your PHP configuration.