Вы находитесь на странице: 1из 2

CSharp Programming: OOP II Laboratory Exercise

EXERCISE CREATING THE DATABASE IN SQL SERVER 2008

2
OBJECTIVES
 Be able to create student database and tables in Microsoft SQL Server
Management Studio 2008
 Be able to identify what appropriate data type should be used for specific
data that will be stored in the database.

Direction:

1. Open SQL Server 2008. A form connecting the SQL Server will be shown as the form below.

Set the following:

Server type: Database Engine


Servername:
 Select from the combobox,
browse for more…>> Local Server
>> Database Engine >> then select PC# >> OK

Authentication: SQL Server Authentication


Username: sa
Password: mysql

Then click connect button

2. Now on the SQL IDE, on the Object Explorer, right click on the folder >> New
Database… >> On the New Database form, set Database name as dbSTUD >> then click OK.

3. Expand the + sign of the for by double clicking it and you will see that the
database dbSTUD is already created.

MR. JORDAN T. COLCOL, Saint Tonis College, Inc.


CSharp Programming: OOP II Laboratory Exercise

4. Now, we create table inside dbSTUD database. Double click the + sign of
and look for the folder Tables. Right click Table folder >> New Table..

Input the following in the New Table

5. After completion, we need to set the primary


key of the following table.

1. Select IDNo in the Column Name

2. Right click >> Select Set Primary Key

6. Set the name of the table as tblStud in the


Propertis Window

7. After setting the table name, close the table. Now if we try to expand the folder Tables from the Object
Explore, You will see now a table name as dbo.tblStud. This is as shown below:

8. Right click >> Select Edit Top 200 Rows.

9. Input at least 5 records of student in the table tblStudent you have created.
Note: Be sure to fill up all fields.

MR. JORDAN T. COLCOL, Saint Tonis College, Inc.

Вам также может понравиться