Connection to MSSQL Database

In this chapter you will find detailed information on how to install and configure the MsSQL Database in order to connect your aqua server to the database. If you want to use an Oracle Database, please follow the installation steps described in the chapter Oracle Database.

Install MSSQL Database

You can download a free version of MSSQL Database using the following link. However. please note that this version is limited to 10GB per Database. Hence, we do not recommend to use this version for productive use and do not provide support in case your database has reached this limitation.
Then download ENU\x64\SQLEXPRADV_x64_ENU.exe
Execute the file that the SQL Server Installation Center opens. Install a New SQL Server stand-alone installation.
Read the license terms, accept them and click on Next. It is possible to include SQL Server product updates if available.
The updates are downloaded, extracted and installed in the next step. Now, the actual installation will start.
Choose the following options and click on Next.
In the next window, the instance name is defined. The default value is SQLExpress. You may rename it, but be sure to remember this name for later configuration. This Wiki description continue to use the default value SQLExpress. After configuration, please click on Next.
In the following step the database authentication mode is configured. For the setup, Mixed Mode is used and an Administrator password entered.
After that, proceed to the next step. In Reporting Services Configuration chose Install and configure and click on Next. Then click on Next twice to begin the installation process. Finally, the installation is completed and you can close the SQL Server 2012 Setup Window.

Database Configuration

Open SQL Server Management Studio and login as Administrator.
Creating a new database
First create a new database:
Enter the database name aqua and proceed by clicking on OK.
Creating a new Login
Now create a new login.
Enter the login name aqua_db_user and switch to SQL Server authentication. Enter a password, for example aqua. Activate Enforce password policy as required by your company guidelines. Simple passwords may require you to deactivate Enforce password policy.
Switch to User Mapping and enter the following:
Finally, click on OK.
Activate additional features for MS SQL (otherwise aqua server will not start)
Starting with Version and higher versions, MS SQL requires additional properties to be activated.
1. Open SQL Server Management Studio (should be already open)
2. Right-click your aqua DB and choose Properties
3. Select Options on the left and set the following two properties to True
    a. Allow Snapshot Isolation (German: “Momentaufnahmeisolation zulassen”)
    b. Is Read Committed Snapshot On (German: „Ist aktivierte READ COMMITTED-Momentaufnahme“)
4. Finally click Yes on the following dialog and you are done!
Importing database
In the Main Window of Microsoft SQL Server Management Studio in the menu bar click on File->Open->File and open the aquaDemoGermanDatabase.sql or aquaDemoEnglishDatabase.sql. If an information dialog is displayed about Inconsistent Line Endings choose Windows (CR LF) and accept this by clicking Yes. Choose database aqua and execute the sql query by clicking the Execute Button
This can take about 10 seconds. After executing the query, there should be a green hint, stating that the query was executed successfully.
Open file diff.sql and execute that file within the same database. This query should work faster. Once the query is executed successfully, it will display the following hint:
In the database, the customer must be updated to the right license file. For that open the license file in folder
C:\Programm Files\andagon GmbH\aqua for IIS\>YOUR SERVER<\Licenses\*.lic
and copy the value of the CustomerAccount into the following sql query of a new Microsoft SQL Server Management Studio query:
update dbo.Customer set Account = 'Enter your Customer Account here'
and click on Execute. Your license file is registered in your aqua database. You can close Microsoft SQL Server Management Studio now.
Configuring aqua Database Connection
Connect the aqua server to your MSSQL Sever. In order to do so, open the following XML Configuration File with Notepad:
C:\Programm Files\andagon GmbH\aqua for IIS\Web\Webservice\Web.config
Your database connection is specified in the following line. Please change this line accordingly.
<add key="Database" value="DataSource=localhost\SQLExpress;Initial Catalog=aqua;User Id=aqua_db_user;Password=aqua"/>
Now your aqua server is connected to the database. In order to start your aqua server, open the Internet Information Service Manager (in the following IIS Manager) and make sure that all three aqua Application Pools are started.
In order to check if an aqua client is able to connect to your aqua server, please install your aqua client locally on the server. In order to do so, install aqua.msi. Follow the instructions and complete the installation.
After installation start aqua. A login screen will be displayed. Here you have to enter:

Try to Login with the given aqua credentials.