Download Using the SQL Server

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

IMDb wikipedia , lookup

DBase wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Tandem Computers wikipedia , lookup

Oracle Database wikipedia , lookup

Database wikipedia , lookup

Microsoft Access wikipedia , lookup

Ingres (database) wikipedia , lookup

Team Foundation Server wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Btrieve wikipedia , lookup

Database model wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational model wikipedia , lookup

Open Database Connectivity wikipedia , lookup

SQL wikipedia , lookup

PL/SQL wikipedia , lookup

Microsoft SQL Server wikipedia , lookup

Transcript
Chapter 6
Using the SQL Server
BC30
Using the SQL Server
1 5/2010
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
5 Exporting the SQL database to Excel .......................................................... 12
BC30
Using the SQL Server
2 5/2010
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:
a. Start the E3DM program and choose the "Databases" option in the "General"
menu bar:
BC30
Using the SQL Server
3 5/2010
b. Select "Add" and start the database connection wizard:
c. Under "Server", enter: DOMAIN\SQLEXPRESS
(You can find the name of the domain under "User Accounts" in the Control
Panel)
BC30
Using the SQL Server
4 5/2010
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":
f. Under "Data Pool not found", press "Continue" and the new database is created.
BC30
Using the SQL Server
5 5/2010
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
l. Close all programs and log off as administrator.
BC30
Using the SQL Server
6 5/2010
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
...".
f. The control panel "Save Database-BC30 Measurements" opens.
BC30
Using the SQL Server
7 5/2010
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
c. Place the cursor over the "Databases" field, right-click on this field and then on
the field "Restore Database".
BC30
Using the SQL Server
8 5/2010
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.
b. In the upper menu bar "General", click on the "Databases" field.
BC30
Using the SQL Server
9 5/2010
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.
e. Switch to the "General" menu bar, click on the "Visualization" field to open the
visualization screen. Using the "Add Channels" button, select a data record, in
this case "Gas analysis CH4 value curr....", select the display options for the
graphical representation and click on the "Finish" field. Repeat this operation for
each data record that you wish to display. You can also assign the data records
to different visualizations. You can also define your own scales using the "Add
Scales" button
BC30
Using the SQL Server
10 5/2010
f. The curves are then displayed under the "Diagram" tab. Choose "Process
Channels" or double-click the corresponding line to open the processing menu.
Here, you can add the measurement display and a mean value display to the
curves.
BC30
Using the SQL Server
11 5/2010
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".
Establish the connection to your SQL Server using DOMAIN\SQLEXPRESS.
BC30
Using the SQL Server
12 5/2010
BC30
Using the SQL Server
13 5/2010
Select the relevant database:
Click on "Finish" and use "Table" to select the relevant format:
The imported table is then displayed on the screen.
BC30
Using the SQL Server
14 5/2010
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.
The following list provides you with information about the
characteristics of the most important measured values. If the
measured value you require is not listed in the table, please contact
our service team.
BC30
Using the SQL Server
15 5/2010