BC30 Using the SQL Server 1 5/2010
Chapter 6
Content
1 Installing and setting up the SQL Server ... 3
2 Exporting an SQL database... 7
3 Importing an SQL database... 9
4 Opening the SQL database and displaying the measurements ... 10
1 Installing and setting up the SQL Server
In this manual, we assume that your PC has both an administrator level and at least one user level. If both levels are not separated, the process of installing and setting up the SQL Server is simplified accordingly.
SQL Server is a database program created by Microsoft and is available in two versions: SQL Server 2005 and SQL Server 2008.
Attention: The descriptions below relate exclusively to the 2008 version.
Users can download and use a simplified version, SQL Server Express 2008, free of charge. To do this, enter the phrase "SQL Server Express download" in your browser and you will be directed to the relevant Microsoft site. Follow the installation instructions exactly as described. To set up the server, use the program "SQL Server Management Studio".
Attention: You must be logged on with administrator rights to execute the following steps!
The first step involves setting up a database. To do this, you need the E3DM software supplied by Esters:
b. Select "Add" and start the database connection wizard:
c. Under "Server", enter: DOMAIN\SQLEXPRESS
d. In the next input field, choose the "Windows-Auth." option:
e. In the next input field, activate the field "Create Database" and enter a name, e.g. "BC30 Measurements":
In the next step, start SQL Server Management Studio g. Enter the server: DOMAIN\SQLEXPRESS
h. In the Object Explorer, you will find under DOMAIN\SQLEXPRESS... Databases Gas concentrations Safety Log-ons ... ... PREDEFINED\User
i. Right-click on "PREDEFINED\User" and in the menu that opens, activate "Properties".
j. The following path opens: "Log-on Properties-PREDEFINED\User" and under "User Assignment", you can find the database "BC30 Measured Data".
k. Select "BC30 Measured Data" with a check mark and, under "Membership in Database Role: BC30 Measured Data" the fields:
db_datareader db_datawriter db_owner public
2. Exporting an SQL database
Proceed as follows:
a. Log on to the user level.
b. Start "SQL Server Management Studio"
c. Connect to the server "DOMAIN\SQLEXPRESS"
d. Right-click the relevant database (in this case: "BC30 Measurements").
e. In the menu that opens, click on the item "Tasks" and from there the item "Save ...".
g. Click "OK", you will find the save DATABASE.bak file under the path C:\Programs\Microsoft SQL
Server\MSSQL10.SQLEXPRESS\MSSQL\Backup\BC30 Measurements.bak h. From here, you can copy the file to any data carrier.
i. To display the data again, you must restore the file. The procedure for doing this is described under "Importing an SQL database".
3 Importing an SQL database
If the database was created on a different computer, it is stored as a bak file with the file extension "bak". This file must therefore be restored using Microsoft SQL Server Management Studio.
Proceed as follows:
a. Copy the file into the directory
C:\Programs\Microsoft SQL Server\MSSQL10.SQLEXPRESS\MSSQL\Backup b. Start Microsoft SQL Server Management Studio
d. Choose a name for the file to be restored and enter the data source (the backup file) and select the "Restore" box.
e. You can now use E3DM to display data.
4. Opening the SQL database and displaying the measurements
Procedure:
a. Start the E3DM program.
c. A list of available databases opens. Select your required database and click on the "Add" field. The database connection wizard opens.
d. Select the correct server: DOMAIN\SQLEXPRESS, enter the access data (this is generally "Windows-Auth."), choose the relevant file when selecting the database and choose "Finish" to complete the operation.
On the bottom edge of the screen, you can define the time period to be displayed: 1 minute up to 365 days and you can use the two outer arrow keys to move this along the time axis.
5. Exporting the SQL database to Excel
You can also import the data into Excel. The procedure described here relates to the Excel 2007 version. The procedure for previous or newer versions may differ slightly.
a. Start Excel
b. Under "Insert>From other sources", choose "From SQL Server".
Select the relevant database: