Implementing database concepts to develop an application in agile approach : Part 1.2 (Database Server)
Installing Microsoft SQL Server 2005:
This server is automatically installed when we install Visual Studio 2008. Or you can download the server file from http://www.microsoft.com/Sqlserver/2005/en/us/express.aspx.
Installing Microsoft SQL Server 2005 Management Studio Express:
To working on the SQL Server, you need to install a management tool. You can download this from http://www.microsoft.com/downloads/details.aspx?familyid=C243A5AE-4BD1-4E3D-94B8-5A0F62BF7796&displaylang=en this location.
OK. Now we are ready to work on the SQL Server.
When you lunch the management studio express, the following window will appear.
In this case, MAGICBOX is the server name and SQLEXPRESS is the instance name of the sql server 2005 on which we are currently working on.
Authentication:
Sql server provides you couple of types of authentication. In Windows Authentication, server assumes since you logged into the machine, you are authenticated to access on the server. But if you use the other type (SQL Server Authentication), you have to enter the credentials of User name and the Password field of that server instance.
Now we will create the table in database.
Walkthrough 1: Creating ‘t_Student’ table using SQL Server Management Studio Express
Steps:
1. Go to: StartMicrosoft SQL Server 2005SQL Server Management Studio Express
2. The following window will appear
3. Click the ‘Connect’ button
4. There are several nodes you will find on which you can work with. Each of the nodes explains itself.
7. Enter the database name meaningful. For our user requirement, we will enter ‘ABCUniversityDatabase’ as the name.
8. Click on the button given in the following figure to select the destination path of the database files
14. Click on ‘New Table’ option
15. Enter the column names given in the following figure
18. You will find your just created table in here
Figure 1: SQL Server Management Studio Express
I am giving you the short description of the SQL Server Management Studio Express opening window. Please Google yourself if you want to know more on this topics.
Server name:
In your computer, you may have several instances on of sql server 2005, or different versions of sql server like as 2005, 2008 etc. you will give them a specific name to work with it.In this case, MAGICBOX is the server name and SQLEXPRESS is the instance name of the sql server 2005 on which we are currently working on.
Authentication:
Sql server provides you couple of types of authentication. In Windows Authentication, server assumes since you logged into the machine, you are authenticated to access on the server. But if you use the other type (SQL Server Authentication), you have to enter the credentials of User name and the Password field of that server instance.
Now we will create the table in database.
Walkthrough 1: Creating ‘t_Student’ table using SQL Server Management Studio Express
Steps:
1. Go to: StartMicrosoft SQL Server 2005SQL Server Management Studio Express
2. The following window will appear
Figure 2: Opening Window of Management Studio
4. There are several nodes you will find on which you can work with. Each of the nodes explains itself.
Figure 3: Explorer of Management Studio
5. Right click on the ‘Databases’ node
6. Click on ‘New Database’7. Enter the database name meaningful. For our user requirement, we will enter ‘ABCUniversityDatabase’ as the name.
8. Click on the button given in the following figure to select the destination path of the database files
Figure 4: Select the Destination Path
9. Click ‘OK’
10. You will find the following figure on your screenFigure 5: Newly Created Database
11. Check your HDD file location to check the database file
Figure 6: Files created in your hard disk
12. Now expand the ‘ABCUniversityDatabase’ on your management studio express
13. Right click on the ‘Tables’ node14. Click on ‘New Table’ option
15. Enter the column names given in the following figure
Figure 7: Column Definition of student's table
16. Click on save option and enter the table name as ‘t_Student’
17. Now expand the ‘Tables’ node from Object Explorer window18. You will find your just created table in here
Figure 8: Columns Viewed in Explorer
Thus you have created a table (t_Student) in your database (ABCUniversityDatabase) to store data (information of studetns). :)
In my next post i will show you how to create the application in C#, which will take the information from the user and store it in the table.
Happy coding.
Comments