Instructor InputsSession 4..Session OverviewThis session includes the following topics: potx

16 204 0
Instructor InputsSession 4..Session OverviewThis session includes the following topics: potx

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

Thông tin tài liệu

Instructor Inputs Session 4 ¤NIIT Instructor Inputs 4.3 This session includes the following topics:  Creating partitioned indexes  System-defined stored procedures  Best practices  Tips and Tricks  FAQs Slide 1 Installing Windows XP Professional Using Attended Installation Slide 1 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Objectives In this session, you will learn about: Creating partitioned indexes System-defined stored procedures Best Practices while using the views, batches, stored procedures, and functions in SQL Server 2005 Tips and Tricks that will help you use views, batches, stored procedures, and functions in SQL Server 2005 FAQs related to procedures and full text index in SQL Server 2005 Session Overview 4.4 Instructor Inputs ¤NIIT Slide 2 Installing Windows XP Professional Using Attended Installation Slide 2 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Knowledge Byte In SQL Server 2005, indexes can also be partitioned based on the value ranges. Partitioned indexes help improve query performance. To create a partitioned index, you need to perform the following tasks: Create a partition function. Create a partition scheme. Create a clustered index. Slide 3 Installing Windows XP Professional Using Attended Installation Slide 3 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Knowledge Byte (Contd.) SQL Server 2005 provides a set of system-defined stored procedures used for general maintenance of a particular database or the database server in whole. Microsoft Word Document ¤NIIT Instructor Inputs 4.5 Slide 4 Installing Windows XP Professional Using Attended Installation Slide 4 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Best Practices Keep the stored procedures as small as possible. This is useful in a situation where two users are accessing the same stored procedure at the same time and the two query plans are stored in the cache. Ensure that all stored procedures return a value indicating their status. This will help evaluate their success or failure status. While creating a view if the records are combined from multiple tables having different number of columns, you should use the UNION ALL operator. When performing any operation on a table, such as inserting columns in a table, keep refreshing the dependent views. Slide 5 Installing Windows XP Professional Using Attended Installation Slide 5 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Tips and Tricks Use SET_NOCOUNT_ON at the beginning of SQL batches, stored procedures, and triggers. This will increase the performance by reducing network traffic. Use the following procedure to find keywords in stored procedures: CREATE PROCEDURE <proc name> @<var name> VARCHAR(100) AS SELECT routine_name FROM INFORMATION_SCHEMA.ROUTINES WHERE routine_definition LIKE '%' + @<var name> + '%‘ ORDER BY 4.6 Instructor Inputs ¤NIIT Slide 6 Installing Windows XP Professional Using Attended Installation Slide 6 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Tips and Tricks (Contd.) Use catalog views to access metadata of different objects in SQL Server 2005. It is a rich mechanism that does not require access to system tables. Use a batch to execute a set of SQL statements. Use procedures to use a set of SQL statements more than once. Procedures allow you to save a set of SQL statements whereas batches are temporary in nature. Slide 7 Installing Windows XP Professional Using Attended Installation Slide 7 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Can you write SQL Server 2005 stored procedures without the knowledge of any T-SQL statements? The belief that the SQL Server 2005 stored procedures can be written without the knowledge of T-SQL statements is partially true. While it is technically possible to create a stored procedure without using T-SQL, it is not possible to access any data without using T-SQL statements. FAQs ¤NIIT Instructor Inputs 4.7 Slide 8 Installing Windows XP Professional Using Attended Installation Slide 8 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Can a view contain a CASE statement? Yes, you can use a CASE statement in a view, but you have to create the view by using Query Analyzer and not SQL Server Enterprise Manager. There is a limitation in creating views in Enterprise Manager when the view contains a CASE statement. FAQs (Contd.) Slide 9 Installing Windows XP Professional Using Attended Installation Slide 9 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Can you use the FREETEXT predicate in a programming language with a SELECT statement? Yes, the FREETEXT predicate can be used in a programming language with a SELECT statement in the same way as it is used in SQL Server. FAQs (Contd.) 4.8 Instructor Inputs ¤NIIT Slide 10 Installing Windows XP Professional Using Attended Installation Slide 10 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Is it must to create a unique index on a table before creating a full-text index on it? Yes, it is must to create a unique index on a table before creating a full-text index on it. FAQs (Contd.) Slide 11 Installing Windows XP Professional Using Attended Installation Slide 11 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Can you create more that one full-text index on a table? Yes, you can create more than one full-text index on table on different columns. When you use the different full-text predicates with the SELECT statement, the suitable full-text index is automatically selected. FAQs (Contd.) ¤NIIT Instructor Inputs 4.9 Slide 12 Installing Windows XP Professional Using Attended Installation Slide 12 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Challenge Which system-defined stored procedure is used to rename a view? sp_renamedb sp_configure sp_recompile sp_rename Answer: sp_rename Slide 13 Installing Windows XP Professional Using Attended Installation Slide 13 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Collaborate Session 4 Challenge (Contd.) Which of the following is the correct description for the sp_configure stored procedure? Its is used to display information about SQL Server configuration Its is used to set the configuration of SQL Server 2005 Its is used to enable the CLR integration feature in the database Its is used to extract the CLR integration information of the database Answer: Its is used to enable the CLR integration feature in the database 4.10 Instructor Inputs ¤NIIT Slide 14 Installing Windows XP Professional Using Attended Installation Slide 14 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Challenge (Contd.) Which edition of SQL Server 2005 allows partitioning? Express Edition Enterprise Edition Standard Edition Developer Edition Answer: Enterprise Edition Slide 15 Installing Windows XP Professional Using Attended Installation Slide 15 of 16 Ver. 1.0 Querying, Managing, and Administering Databases Using SQL Server 2005 Colla borate Session 4 Challenge (Contd.) While creating a partitioned index, what do you create after creating a partition scheme? Partition function Partition table Clustered index Nonclustered index Answer: Clustered index [...]... 4.12 Instructor Inputs NIIT Home Assignment 1 Which of the following is true about renaming a view? a A view is renamed by using the sp_renameview procedure b A view can only be renamed by the owner of the database c A view can be renamed from another database d A view name must follow the rules for identifiers 2 Michael has created a full-text index on the Author column of the Titles table by using the. .. depending on the grade of the employees H wants to create a batch to perform the task but is facing a problem while creating a batch Identify the problem a Sam cannot create a batch for the ALTER TABLE statement NIIT Instructor Inputs 4.13 b c d Sam cannot create a batch that alters the table by adding a column and then updates the same column in the table Sam cannot create a batch that uses the ALTER... various limitations of views Instructor Inputs You can conduct the discussion as follows: Discuss the limitations on views while creating a view Move the discussion to the limitations of views that have been created Solution While creating views, you should consider the following guidelines: The name of a view must follow the rules for identifiers and must not be the same as that of the table on which it... view can be created only if there is a SELECT permission on its base table A view cannot derive its data from temporary tables In a view, ORDER BY cannot be used in the SELECT statement Views do not maintain a separate copy of the data, but only display the data present in the base tables Therefore, you can modify the base tables by modifying the data in the view However, the following restrictions exist... the following command CREATE FULLTEXT INDEX ON Titles (Author) KEY INDEX Ix.A Which of the following is an alternative to the given command to create a full-text index? a Right-click the table in the Object Explorer window Select Full-Text Index->Define Full-Text Index b Right-click the database in the Object Explorer window Select Full-Text Index->Define Full-Text Index c Select the database in the. .. statements together Sam cannot create a batch to add new columns in the table 6 You are using the TRY…CATCH construct to execute a set of statements Which system function returns the name of the stored procedure or trigger in which the error has occurred? a ERROR_PROCEDURE() b ERROR_LINE() c ERROR_TRIGGER() d ERROR_MESSAGE() 7 Which RAISERROR severity level transfers the control from the TRY block to the CATCH... 10 to 16 8 Which of the following is an invalid statement to execute a procedure named myproc? a EXEC myproc b EXEC PROCEDURE myproc c EXEC PROC myproc d EXEC PROCEDURE 9 Consider the following code snippet: CREATE PROCEDURE myproc @pr1 int, @pr2 char(50) OUTPUT, @pr3 int OUTPUT AS BEGIN …………… ………… END Which of the following is a correct explanation of the preceding code snippet? a The code creates a... view name must follow the rules for identifiers Right-click the table in the Object Explorer window Select Full-Text Index->Define Full-Text Index 3 Full population method 4 Incremental timestamp-based population method 5 Sam cannot create a batch that alters the table by adding a column and then updates the same column in the table 6 ERROR_PROCEDURE() 7 11 to 19 8 EXEC PROCEDURE 9 The code creates a... parameters b The code creates a procedure named myproc with one input and two output parameters c The code creates a procedure named myproc with three variables to store data d The code creates a procedure named myproc with invalid syntax 4.14 Instructor Inputs NIIT 10 Which of the following is not a component of UDF declaration? a Input parameter name and data type b Options applicable to the input parameter... wants to update the new records from the base table to the full-text indexed table Which population method should Harry use? a Change tracking-based population method b Incremental population method c Full population method d Incremental timestamp-based population method 5 Sam wants to add a column named Incentive in the Employee table Sam also wants to update the Incentive column of the existing records . Instructor Inputs Session 4 ¤NIIT Instructor Inputs 4. 3 This session includes the following topics:  Creating partitioned indexes  System-defined. ¤NIIT Instructor Inputs 4. 13 1. Which of the following is true about renaming a view? a. A view is renamed by using the sp_renameview procedure. b. A view can only be renamed by the owner of the. in the SELECT statement. Views do not maintain a separate copy of the data, but only display the data present in the base tables. Therefore, you can modify the base tables by modifying the

Ngày đăng: 31/07/2014, 15:20

Tài liệu cùng người dùng

  • Đang cập nhật ...

Tài liệu liên quan