TAILIEUCHUNG - Beginning SQL Server 2005 for Developers From Novice to Professional phần 4

một số trong đó có thể được xúi giục bởi T-SQL và một số sản phẩm của các hành động được thực hiện. • Auto Update: Đây là một lựa chọn phổ biến hơn để có thiết lập để thực, ngay cả trên các máy chủ sản xuất, mặc dù vẫn còn có một sự xuống cấp hiệu suất. | 136 CHAPTER 5 DEFINING TABLES Defining a Table Using a Template SQL Server has a third method of building tables although this is my least favored method. A large number of templates are built into SQL Server Management Studio for everyday tasks. It is also possible to build your own template for repetitive tasks which is where I can see more power for developers in this area. Templates can be found in their own explorer window. Selecting View Template Explorer or pressing Ctrl Alt T brings up the Template Explorer window displayed initially on the right-hand side of SQL Server Management Studio. Try It Out Creating a Table Using a Template 1. Expand the Table node on the Template Explorer. About halfway down you will see a template called Create Table as shown in Figure 5-13. Double-click this to open up a new Query Editor pane with the template for creating a table. Figure 5-13. List of templates CHAPTER 5 DEFINING TABLES 137 2. Take a close look at the following which is the listing from the template. A template includes a number of parameters. These are enclosed by angle brackets . -- Create table template USE database sysname AdventureWorks GO IF OBJECT_ID schema_name sysname dbo . table_name sysname sample_table U IS NOT NULL DROP TABLE schema_name sysname dbo . table_name sysname sample_table GO CREATE TABLE schema_name sysname dbo . table_name sysname sample_table column1_name sysname c1 column1_datatype int column1_nullability NOT NULL column2_name sysname c2 column2_datatype char 10 column2_nullability NULL column3_name sysname c3 column3_datatype datetime column3_nullability NULL CONSTRAINT contraint_name sysname PK_sample_table PRIMARY KEY columns_in_primary_key c1 GO 3. By pressing Ctrl Shift M you can alter these parameters to make a set of meaningful code. Do this now so that the parameters can be altered. Figure 5-14 shows most of our third table TransactionDetails. TransactionTypes. The reason I say most is that our template code only deals with .

Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.