0% found this document useful (0 votes)
76 views2 pages

Creating The Database in SQL Server 2008 Exercise: Csharp Programming: Oop Ii Laboratory Exercise

This document provides instructions for creating a student database and tables in Microsoft SQL Server 2008. The steps include: 1. Connecting to the SQL Server and selecting the local database engine 2. Creating a new database called "dbSTUD" 3. Creating a new table called "tblStud" within the dbSTUD database with various data fields and setting the primary key 4. Inputting at least 5 sample records into the new tblStud table to populate it with test data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
76 views2 pages

Creating The Database in SQL Server 2008 Exercise: Csharp Programming: Oop Ii Laboratory Exercise

This document provides instructions for creating a student database and tables in Microsoft SQL Server 2008. The steps include: 1. Connecting to the SQL Server and selecting the local database engine 2. Creating a new database called "dbSTUD" 3. Creating a new table called "tblStud" within the dbSTUD database with various data fields and setting the primary key 4. Inputting at least 5 sample records into the new tblStud table to populate it with test data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 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.

You might also like