As the knowledge of the database is still in the beginner stage, for some knowledge is not very understanding, so inevitably there will be errors, in the future study will also be modified and perfected. There is a self-study database knowledge, in the process of Learning C # project has a simple introduction and application, the teacher also simply let us understand the database and data table some simple operation. That's how to start SQL Server 2008 and databases, and create and delete data tables.
In the online a lot of database video explanation, finally chose I want to self-study network of the video (SQL Server database tutorial), also my brother to my Jiang Jianling SQL Server 2000 video tutorial, combined with these two database video tutorial, I am in step-by-step learning. Learning database knowledge can not avoid reading, from the internet bought a SQL Server (mainly 2008 version) from the Introduction to proficiency (Tsinghua University Press), that there is time to take out to learn, slowly understand the basic knowledge of the database, then to start the database of the blog in depth.
first look at how to start SQL Server (There are about three ways but only one way).
First find the computer icon in your computer interface, right click, Find management click on it, will appear a Computer Management dialog box.
Then find the service and application on the left side of the dialog, click it, find the service click on it, a list of all the services in a computer, find SQL Server (MSSQLSERVER) in the list, and its status is not started.
In the end, we are going to start the service, right-click on SQL Server (MSSQLSERVER), click Start, or you can click Start on the top left of the service. This completes SQL Server (MSSQLSERVER).
Registering SQL Server
In the Start menu, locate SQL Server Management Studio, and click Start it.
When it is started, it will go to the main interface, and a dialog box will pop up that connects to the server, with two types of authentication in the dialog box, one for Windows authentication and one for SQL Server authentication, which is the case for the two general choices.
Using Windows authentication, this is a native server. Server type must choose the database engine, and then the server name, this can have a lot of choices, the general simplest is to use a point, that is, the local server, you can also enter the server IP address of the computer and Internet access to the IP address, which can be successfully connected to the server.
With SQL Server authentication, this is super-authentication, and the above three items remain consistent with the above, with the SA and 123456 (which is also set by yourself) in the login name and password to connect to the server.
creation and deletion of databases
Connect to the server and then go to the interface we often use, on the left is the Object Explorer, there are menu bar and toolbar, these need to slowly contact and familiar with themselves in order to strengthen in the later use process.
Locate the database under Object Explorer, right-click it, select New database, and a New Database dialog box appears.
In the New Database dialog box, type the database name and save path, and then click OK.
Once created, you can see the Customermanagement database you created by double-clicking on the left side of the database, which contains tables, views, and so on.
A simple way to delete a database is to locate the database you want to delete under Object Explorer and right-click it to select Delete.
creation and deletion of data tables
After the creation of the database, we can create the data table, take a project to be done (customer management System) to create, here is a customer data storage to create and delete the table.
In the left side of the Object Explorer to find the Customermanagement database you created, double-click to open it, right-click on the table, select New table, you can go to create the table interface.
Create an instance of the table for the customer management system to hold the customer information of the Customers table, find the table of the document, to create the table.
Type information in the table, enter the column name, the data type, and whether to allow null values. The content of the last document is to provide the input information. There is also to set the primary key (that is, self-growth), the general setting ID is the primary key. The information is entered later.
After you type the information, the data table is the Customer table, and the data table is created on the left with the name customer.
The deletion of the data table is as simple as finding the data table you want to delete in the Object Explorer and right-clicking it to select Delete.
Database and data table creation and deletion