Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
2,2 Xác định cơ sở dữ liệu Bàn Fields A SQL Server không làm nhiều tốt trừ khi bạn có bảng trong nó. Hướng dẫn này không chỉ cung cấp cho bạn thông tin về cách để tạo bảng và các lĩnh vực, nhưng cũng dạy bạn làm thế nào để tên họ và những gì để tìm ra cho khi tạo ra chúng | 2.2 Define Tables and Fields A SQL Server database doesn t do much good unless you have tables in it. This tutorial not only gives you information on how to create tables and fields but also teaches you how to name them and what to look out for when creating them. Databases by themselves don t do much for you but you need to be able to store data in them at the very least. To do this you need to be able to create tables which are made up of fields. How do you go about defining tables and fields in VS .NET Technique Using the Server Explorer and accessing the Table designer you are going to create a table called tblCustomers in the database that you created in the previous How-To. You will then add columns to the database that will store various pieces of information having to do with individual customers. Last you will create another table called tblPhones and also create the necessary columns that will contain information about phone information for your customers. Steps After Visual Studio .NET is opened expand the Server Explorer and locate your new database called Chapter2 created in How-To 2.1. Click on the plus sign by the database names so that the database object categories are listed. 1. Right-click on the Tables node under the Chapter2 database and choose New Table. You will then be presented with the Table Designer. Now you are ready to add the columns. 2. To add a column you need to set four immediate properties o Column Name. This is the name of the column. Don t use spaces or special characters but do use proper case and make sure that the name you give the column makes sense for what it contains. For instance if the column is for the last name of a customer put LastName for the Name property of the column. o Data Type. Depending on the type of data that will be entered into the column this will be one of the many valid data types for SQL Server shown here in Table 2.1. Table 2.1. SQL Server Data Types Data Type Description bigint Integer whole number