Search This Blog

Databses

In this post i will show you how to create a table in Microsoft SQL server 2008 (Management Studio).
In order to create a table in sql server 2008 we must first create a database. The picture above shows the left pane(object explorer) in the sql server management studio. This is the easiest way of creating databases. We have to left click the highlighted circle shown in the above picture and select 'New database'.
when we click the 'New Database' option the following window is displayed. Here we have to give the database a name. I gave it as Test_Database then we click the 'ok' button.
Expand the database option from the object explorer. This will display all the databases created by the management studio.Select Test Database and expand.Once we expand this you will have a few options which also includes a 'Table' option. Left click Table and select 'New Table' as shown in the picture below:
Once we click 'New Table', the management studio will display a pane where we can enter the required fields,data types and field constraints.In the picture below i have entered two fields(Student_ID and Student_Name) the data types can be selected through a drop down list.
Once we are finished entering the fields we can click the save button. To save the table we must give the table a name. We can either leave it to its default name that is Table_1 or give any name we wish.
Now we have finished creating a table. We can also create it through sql commands.

No comments:

Post a Comment