Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Cơ sở dữ liệu và các bản ghi giao dịch tăng kích thước không chỉ với dữ liệu đầu vào tăng, mà còn thông qua các hành động khác, mà chúng ta sẽ thảo luận chi tiết hơn trong Chương 7. Bạn có thể thu nhỏ kích thước của file bản ghi thông qua các hành động nhất định, | CHAPTER 3 DATABASE DESIGN AND CREATION 83 Auto Shrink Database and transaction logs grow in size not only with increased data input but also through other actions which we ll discuss in more detail in Chapter 7. You can shrink the size of the log file through certain actions some of which can be instigated by T-SQL and some as a by-product of actions being performed. Auto Update Statistics This is a more common option to have set to True even on production servers although there is still a performance degradation. This option will update statistics as data is inserted modified or deleted for tables for use in indexes and it will also update statistics for columns within a table. We ll discuss indexes further in Chapter 6. 6. Click the OK button at the bottom of the screen to create the database. SQL Server will now perform several actions. First it checks whether the database already exists and if so you will have to choose another name. Once the database name is validated SQL Server does a security check to make sure that the user has permission to create the database. This is not a concern here since by following this book you will always be logged on to SQL Server with the proper permissions. Now that you have security clearance the data files are created and placed on the hard drive. Providing there is enough space these files will be successfully created and it is not until this point that SQL Server is updated with the new database details in the internal system tables. Once this is done the database is ready for use. As you can see this whole process is relatively straightforward and simple to complete. Congratulations Tip You need not create the database at this point if you don t want to. There are several other options available to you to save the underlying T-SQL to a file to the clipboard or to the Query window. The first two options are very useful as methods of storing actions you re creating to keep in your source code repository such as Visual .