tailieunhanh - Beginning C# 2008 Databases From Novice to Professional phần 2
Mở rộng hệ thống cơ sở dữ liệu nút, và màn hình của bạn sẽ giống như những gì thể hiện trong hình 2-11. Như bạn có thể thấy, SSMS có bốn cơ sở dữ liệu hệ thống: • Cơ sở dữ liệu tổng thể là cơ sở dữ liệu kiểm soát chính, và nó ghi lại tất cả các thông tin toàn cầu là cần thiết cho SQL Server. | CHAPTER 2 GETTING TO KNOW YOUR TOOLS 23 Figure 2-10. SSMSE Object Explorer and Summary tabbed pane 3. Expand the System Databases node and your screen should resemble that shown in Figure 2-11. As you can see SSMS has four system databases The master database is the main controlling database and it records all the global information that is required for the SQL Server instance. The model database works as a template for new databases to be created in other words settings of the model database will be applied to all user-created databases. The msdb database is used by SQL Server Agent for scheduling jobs and alerts. The tempdb database holds temporary tables and other temporary database objects either generated automatically by SQL Server or created explicitly by you. The temporary database is re-created each time the SQL Server instance is started so objects in it do not persist after SQL Server is shut down. 24 CHAPTER 2 GETTING TO KNOW YOUR TOOLS Figure 2-11. System databases 4. Click the AdventureWorks node in Object Explorer and then click New Query to bring up a new SQL edit window as shown in Figure 2-12. As mentioned in Chapter 1 AdventureWorks is a new sample database introduced for the first time with SQL Server 2005. 5. To see a listing of the tables residing inside AdventureWorks type the query select name from sysobjects where xtype U and click the Execute button. The table names will appear in the Results tab see Figure 2-12 . If you navigate to the Messages tab you will see the message 70 row s affected which means that the AdventureWorks database consists of 70 tables. 6. Click File Disconnect Object Explorer. 7. Click the Northwind node in Object Explorer and then click New Query. To see the table names residing inside Northwind type the query select name from sys-objects where xtype U and click the Execute button. A listing of tables in the database will appear in the Results tab see Figure 2-13 . If you navigate to the Messages tab you will see .
đang nạp các trang xem trước