• No results found

Chapter 6. Using the SQL Server

N/A
N/A
Protected

Academic year: 2021

Share "Chapter 6. Using the SQL Server"

Copied!
15
0
0

Loading.... (view fulltext now)

Full text

(1)

BC30 Using the SQL Server 1 5/2010

Chapter 6

(2)

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

(3)

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:

(4)

b. Select "Add" and start the database connection wizard:

c. Under "Server", enter: DOMAIN\SQLEXPRESS

(5)

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":

(6)

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

(7)

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 ...".

(8)

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

(9)

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.

(10)

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.

(11)
(12)

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".

(13)
(14)

Select the relevant database:

Click on "Finish" and use "Table" to select the relevant format:

(15)

HDP_TIMESTAMP is the time stamp of a measurement,

HDP_SIGNAL indicates the measured value e.g. CH4 concentration,

and HDP_SIGNAL_VALUE the measurement. Use the small arrows

in the column headers to access the sorting functions.

References

Related documents

    Each OLE DB Provider has 8 global options that can be configured for all Linked Servers for that provider. 

To quickly see differences between files on the local machine and the server, choose View > Directory Comparison, and choose either "compare file size" or

- Provide the SQL server name, select “SQL Server Authentication” from the drop-down menu, choose the login to be sa, leave the password field empty and then to select your

There are multiple approaches to replicating SQL Server data: you can choose to perform replication at the database level using SQL Server utilities, in the storage hardware itself,

The connector elements are configured in Tomcat’s server.xml file using the <Connector> XML element.. The <Connector> XML element is defined as a nested element within

Create New/Use Existing: If you choose to install to a new SQL Server Database, in the Data Link Properties dialog box on the Connection tab, enter or select the server name where

If you are using the Express version of SQL Server, enter a backslash and then the SQL Server instance name (the default SQL Server instance name is SQLExpress). Select either

In the Safexpert Setup choose SQL Server (Windows authentication) in this case as a database type and indicate the server as seen in the image:. Settings in the