1. Trang chủ
  2. » Công Nghệ Thông Tin

Instructor Inputs - Session 14 pot

26 96 0

Đ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

Thông tin cơ bản

Định dạng
Số trang 26
Dung lượng 1,02 MB

Nội dung

Instructor Inputs Session 14 ¤NIIT Instructor Inputs 14.3 This session includes Chapter 9 and Chapter 10 of the Student Guide. Slide 1 Slide 1 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 In this session, you will learn to: Understand managed code Create managed database objects Define the Hypertext Transfer Protocol endpoints Implement the Hypertext Transfer Protocol endpoints for Web services Objectives Start the session by sharing the objectives with the students. In this session, the students will learn the importance of managed objects and how to create them. In addition, they will also learn how to implement Web services in SQL Server 2005 using HTTP endpoints. Session Overview 14.4 Instructor Inputs ¤NIIT Slide 2 Slide 2 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 CLR integration: Allows the database developer to write the code in any of the .NET supported languages Allows to run managed code within a database Provides the following functions and services required for program execution Introduction to SQL Server CLR Integration In this topic, you need to explain the students about CLR. As they have already read about CLR in the chapter 1, you need not to go into the details of CLR. Explain how CLR has been incorporated in the SQL Server itself. Also explain the benefits of integrating CLR inside SQL Server itself. You can use the examples provided in the Student Guide to clarify the concept to the students. T-SQL has been the conventional language to write database objects, such as stored procedure, triggers and functions. SQL Server 2005 provides the new possibilities to the database developer by integrating .NET Framework in it. SQL Server 2005 allows the database developers to write stored procedures, triggers, user-defined types, user-defined aggregates, and user-defined functions in any of the .NET supported language, build a .dll, register and use it inside a SQL Server. It is very important that the students understand that you are not removing the business or data layer by hosting the C# code in the SQL Server. SQL Server is still a database and is not intended to be used as an application server in your architecture. ¤NIIT Instructor Inputs 14.5 Slide 3 Slide 3 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Managed database objects can be created in the following situations: To implement complicated programming logics To access external resources To implement a CPU-intensive functionality that can run more efficiently as compared to the managed code. T-SQL statements can be used in the following situations: To perform data access and manipulation operations that can be done using the T-SQL statements. To implement programming logic tat can be easily implemented using T-SQL programming constructs. Identifying the Need for Managed Code In this topic, you need to explain the need for managed code to the students. You need to explain the limitations of T-SQL to the students, and how those limitations can be overcome by introducing managed code in SQL Server. T-SQL is a language that is used to manipulate and query data from a database server. It provides a number of database features, such as query plans and caching of query plans and their results. Because of all these features, T-SQL is the best choice for the operations in the SQL Server. But the procedural aspect of T-SQL makes it complicate to use in situations that involve functions such as, complex mathematical computations, recursive operations, and heavily procedural. In addition, T-SQL can not take the advantage of code reuse. If you try to implement all this using T-SQL, the network traffic of your company goes into a loop and results in slow query processing. With the ability to write and host .NET code inside SQL Server 2005, you now can prevent the network roundtrips and host the necessary .NET code right inside SQL Server. 14.6 Instructor Inputs ¤NIIT Slide 4 Slide 4 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Just a minute Which of the following is supported by .NET and not by T-SQL? 1. Writing queries 2. Creating procedures 3. Object-Orientation 4. Writing triggers Answer: 3. Object-Orientation Reiterate the concept taught by asking the given question. Slide 5 Slide 5 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Assemblies: Are created to attach the managed code Are created using the CREATE ASSEMBLY command Syntax: CREATE ASSEMBLY assembly_name FROM { <client_assembly_specifier > | <assembly_bits> [ , n ] } [ WITH PERMISSION_SET = { SAFE | EXTERNAL_ACCESS | UNSAFE } ] Let’s see how… Importing and Configuring Assemblies In this topic, you need to explain the concept of assemblies to the students. In addition, you also need to teach how to import the .NET assembly inside the SQL Server. To clarify the concept, you may provide the students with the example provided in the Student Guide. ¤NIIT Instructor Inputs 14.7 The students have learned about the assemblies in .NET framework. To clarify the doubts of the students, you can specify that the assemblies in .NET are the .dll or .exe files that have provide a specific functionality. In SQL Server 2005, an assembly is a database object that stores the code of .NET assembly. Slide 6 Slide 6 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Just a minute Which of the following PERMISSION_SET will you use to access another database server? 1. SAFE 2. EXTERNAL_ACCESS 3. UNSAFE Answer: 2. EXTERNAL_ACCESS Reiterate the concept taught by asking the given question. Slide 7 Slide 7 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Managed database objects can be of the following types: Stored Procedures Functions Triggers UDTs Creating Managed Database Objects 14.8 Instructor Inputs ¤NIIT Note In this topic, you need to explain the various types of managed database objects that can be created in SQL Server. As students are already aware of these all database objects, you need not differentiate between them. In the following topics, you will show examples given in the Student Guide to demonstrate how to create different types of managed codes. Slide 8 Slide 8 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Managed stored procedure: Is implemented by creating a procedure that refers to an imported assembly Syntax: CREATE PROCEDURE <Procedure Name> AS EXTERNAL NAME <Assembly Identifier>.<Type Name>.<Method Name>, Let’s see how… Creating Managed Database Objects (Contd.) In this topic, you need to explain the concept of creating a managed procedure to the students. These managed stored procedures will have an assembly attached to it. Whenever the stored procedure is executed, the code written in the assembly will be executed. To explain the concept, you can use the example provided in the Student Guide. Before executing the code, you need to copy the ConvertXML.dll file in the C drive of the server. This file is given in the Datafiles_for_faculty\QMDS2005\Chapter 09 folder of the TIRM CD. When explaining the syntax of the command, mention that the EXTERNAL NAME clause specifies the database server to use an external assembly as the code for the procedure. ¤NIIT Instructor Inputs 14.9 Note Slide 9 Slide 9 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Managed function: Is implemented by creating a function that refers to an imported assembly Syntax: CREATE FUNCTION <Function Name> ( <Parameter List> ) RETURNS <Return Type> AS EXTERNAL NAME <Assembly Identifier>.<Type Name>.<Method Name> Let’s see how… Creating Managed Database Objects (Contd.) In this topic, you need to explain the concept of managed functions to the students. Use the example provided in the Student Guide to demonstrate the concept. Before executing the code, you need to copy the CalSalAssembly.dll file in the C drive of the server. This file is given in the Datafiles_for_faculty\ QMDS2005\Chapter 09 folder of the TIRM CD. 14.10 Instructor Inputs ¤NIIT Note Slide 10 Slide 10 of 31Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Managed trigger: Is implemented by creating a trigger that refers to an imported assembly Syntax: CREATE TRIGGER <TriggerName> ON <Table or View> <FOR | INSTEAD OF | AFTER> < INSERT | UPDATE | DELETE > AS EXTERNAL NAME <Assembly Identifier>.<Type Name>.<Method Name> Let’s see how… Creating Managed Database Objects (Contd.) In this topic, you need to explain the concept of managed triggers to the students. Use the example provided in the Student Guide to demonstrate the concept. Before executing the code, you need to copy the ValidateMail.dll file in the C drive of the server. This file is given in the Datafiles_for_faculty\ QMDS2005\Chapter 09 folder of the TIRM CD. [...]... a Web service Ver 1.0 NIIT Session 14 Slide 30 of 31 Instructor Inputs 14. 23 Slide 31 Querying and Managing Data Using SQL Server 2005 Summary (Contd.) HTTP endpoints provide the users with a connecting point through which they can access the implemented functions You can create HTTP endpoints by using the CREATE ENDPOINT statement Ver 1.0 14. 24 Instructor Inputs Session 14 Slide 31 of 31 NIIT FAQs... this, you have decided to create a managed user-defined data type How will you create this data type? Ver 1.0 Session 14 Slide 13 of 31 At the end of this demo, the students will be able to create a user-defined type using a NET assembly 14. 12 Instructor Inputs NIIT Slide 14 Querying and Managing Data Using SQL Server 2005 Demo: Implementing Managed User-Defined Types (Contd.) Solution: To solve the... 3 70 Answer: 1 80 Ver 1.0 Session 14 Slide 21 of 31 Reiterate the learning by asking the given question 14. 18 Instructor Inputs NIIT Slide 22 Querying and Managing Data Using SQL Server 2005 Creating HTTP Endpoints Involves the following tasks: 1 Creating the required database code to access the data 2 Creating an HTTP Endpoint using the CREATE ENDPOINT statement Session 14 Ver 1.0 Slide 22 of 31 In... Web service? 1 WSDL 2 SOAP 3 UDDI Answer: 3 UDDI Ver 1.0 Session 14 Slide 18 of 31 Reiterate the concept by asking the given question 14. 16 Instructor Inputs NIIT Slide 19 Querying and Managing Data Using SQL Server 2005 Identifying the Role of HTTP Endpoints in Native Web Service Architecture HTTP Endpoint: Is the gateway through which HTTP-based clients can query the database server Created for use... folder of the TIRM CD NIIT Instructor Inputs 14. 11 Slide 12 Querying and Managing Data Using SQL Server 2005 Just a minute When will you use managed code instead of T-SQL? 1 When you need to write queries 2 When you need to access external resources 3 When you need to perform an administrative task on the database Answer: 2 When you need to access external resources Ver 1.0 Session 14 Slide 12 of 31 Reiterate... 2005 Introduction to Service-Oriented Architecture (SOA) SOA: Is an extension of distributed computing based on the request/reply design pattern Modularizes the business logic of an application and presents them as services Allows to create objects, such as, Web services that can be accessed from heterogeneous systems Ver 1.0 NIIT Session 14 Slide 15 of 31 Instructor Inputs 14. 13 In this topic, you need... services in SQL Server enables access to an instance of SQL Server anywhere at any time This makes it easier to develop applications for mobile or intermittently connected devices NIIT Instructor Inputs 14. 25 14. 26 Instructor Inputs NIIT ... 1.0 Session 14 Slide 16 of 31 Show the flash presentation to introduce Web services to the students Through this presentation the students will learn about the Web services Inputs for Flash Presentation Screen 1 A user sends a request to a Web server to view a website The website further sends request for data to a Web service The web service provides the required data that is used by the website 14. 14... DEFAULT } ] [ , FORMAT = { ALL_RESULTS | ROWSETS_ONLY } ]) } [ , n ] ] [ BATCHES = { ENABLED | DISABLED } ] [ , WSDL = { NONE | DEFAULT | 'sp_name' } ] Let’s see how… Ver 1.0 NIIT Session 14 Slide 23 of 31 Instructor Inputs 14. 19 In this topic, you need to explain the syntax of CREATE ENDPOINT to the students To clarify this, you can refer to the example provided in the Student Guide Slide 24 Querying... that allows the users to access the data using the Internet How will you implement this service inside the AdventureWorks database? Ver 1.0 Session 14 Slide 25 of 31 By the end of this demo, the students will be able to create an HTTP Endpoint 14. 20 Instructor Inputs NIIT Slide 26 Querying and Managing Data Using SQL Server 2005 Demo: Implementing HTTP Endpoints (Contd.) Solution: To solve the preceding . Instructor Inputs Session 14 ¤NIIT Instructor Inputs 14. 3 This session includes Chapter 9 and Chapter 10 of the Student Guide. Slide 1 Slide 1 of 3 1Session 14 Ver. 1.0 Querying. able to create a user-defined type using a .NET assembly. ¤NIIT Instructor Inputs 14. 13 Note Slide 14 Slide 14 of 3 1Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Solution: To. folder of the TIRM CD. ¤NIIT Instructor Inputs 14. 11 Note Slide 11 Slide 11 of 3 1Session 14 Ver. 1.0 Querying and Managing Data Using SQL Server 2005 Managed user-defined type: Is created by

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