SlideShare a Scribd company logo
Querying and Managing Data Using SQL Server 2005
Objectives


                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




     Ver. 1.0                        Session 16                         Slide 1 of 31
Querying and Managing Data Using SQL Server 2005
Introduction to SQL Server CLR Integration


                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




     Ver. 1.0                        Session 16                            Slide 2 of 31
Querying and Managing Data Using SQL Server 2005
Identifying the Need for Managed Code


                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.




     Ver. 1.0                       Session 16                          Slide 3 of 31
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




     Ver. 1.0                       Session 16                      Slide 4 of 31
Querying and Managing Data Using SQL Server 2005
Importing and Configuring Assemblies


                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…



     Ver. 1.0                     Session 16                       Slide 5 of 31
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




     Ver. 1.0                     Session 16                     Slide 6 of 31
Querying and Managing Data Using SQL Server 2005
Creating Managed Database Objects


                Managed database objects can be of the following types:
                   Stored Procedures
                   Functions
                   Triggers
                   UDTs




     Ver. 1.0                      Session 16                      Slide 7 of 31
Querying and Managing Data Using SQL Server 2005
Creating Managed Database Objects (Contd.)


                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…




     Ver. 1.0                      Session 16                        Slide 8 of 31
Querying and Managing Data Using SQL Server 2005
Creating Managed Database Objects (Contd.)


                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…




     Ver. 1.0                        Session 16                              Slide 9 of 31
Querying and Managing Data Using SQL Server 2005
Creating Managed Database Objects (Contd.)


                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…




     Ver. 1.0                       Session 16                            Slide 10 of 31
Querying and Managing Data Using SQL Server 2005
Creating Managed Database Objects (Contd.)


                Managed user-defined type:
                   Is created by using the CREATE TYPE command
                   Syntax:
                    CREATE TYPE [ schema_name. ] type_name
                    {
                       FROM base_type [ (precision [ , scale ] ) ]
                       [ NULL | NOT NULL ]
                       | EXTERNAL NAME assembly_name[.class_name]
                    }
                Let’s see how…




     Ver. 1.0                    Session 16                 Slide 11 of 31
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 16                          Slide 12 of 31
Querying and Managing Data Using SQL Server 2005
Demo: Implementing Managed User-Defined Types


               •   Problem Statement:
                      The management of AdventureWorks, Inc. has decided that
                      they want to include the details of the spouse of employees in
                      the database. The application that is used to enter the
                      employee detail will accept the name and date of birth of the
                      spouse of an employee. In addition, it will concatenate the two
                      values separated by a ";". As a database developer, you need
                      to store the spouse details in the following format:
                      Spouse Name: <name of the spouse> ; Spouse Date of Birth :
                      <date of birth>
                      To implement this, you have decided to create a managed
                      user-defined data type. How will you create this data type?




    Ver. 1.0                            Session 16                           Slide 13 of 31
Querying and Managing Data Using SQL Server 2005
Demo: Implementing Managed User-Defined Types (Contd.)


                Solution:
                   To solve the preceding problem, you need to perform the
                   following tasks:
                    1. Enable CLR in the database.
                    2. Create an assembly.
                    3. Create a managed database user-defined data type.
                    4. Create a table that will implement the user-defined data type.
                    5. Verify the output.




     Ver. 1.0                          Session 16                                Slide 14 of 31
Querying and Managing Data Using SQL Server 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                      Session 16                           Slide 15 of 31
Querying and Managing Data Using SQL Server 2005
Introduction to Web Services


                Flash presentation: Introduction to Web Services
                Web Service is a collection of methods that provide
                programmable logic used by client applications over the
                Internet.
                SQL Server 2005 provides native XML Web services by
                using the following open standards:
                   Hypertext Transfer Protocol (HTTP)
                   Simple Object Access Protocol (SOAP)
                   Web Services Definition Language (WSDL)




     Ver. 1.0                      Session 16                       Slide 16 of 31
Querying and Managing Data Using SQL Server 2005
Just a minute


                Which of the following describes the Web services?
                1. WSDL
                2. SOAP
                3. UDDI




                Answer:
                1. WSDL




     Ver. 1.0                     Session 16                         Slide 17 of 31
Querying and Managing Data Using SQL Server 2005
Just a minute


                Which of the following helps in finding a Web service?
                1. WSDL
                2. SOAP
                3. UDDI




                Answer:
                3. UDDI




     Ver. 1.0                      Session 16                       Slide 18 of 31
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 with SQL Server 2005 can listen and receive
                    requests on the TCP port (port 80)




      Ver. 1.0                       Session 16                          Slide 19 of 31
Querying and Managing Data Using SQL Server 2005
Identifying the Role of HTTP Endpoints in Native Web Service Architecture (Contd.)



                 HTTP Endpoint Architecture:




      Ver. 1.0                       Session 16                          Slide 20 of 31
Querying and Managing Data Using SQL Server 2005
Just a minute


                On which of the following ports does the SQL Server listen
                for HTTP requests?
                 1. 80
                 2. 90
                 3. 70




                Answer:
                 1. 80




     Ver. 1.0                      Session 16                       Slide 21 of 31
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.




     Ver. 1.0                       Session 16                        Slide 22 of 31
Querying and Managing Data Using SQL Server 2005
Creating HTTP Endpoints (Contd.)


                Syntax:
                CREATE ENDPOINT endpoint_name
                STATE = { STARTED | STOPPED | DISABLED }
                AS HTTP (
                AUTHENTICATION =( { BASIC | DIGEST |
                INTEGRATED | NTLM | KERBEROS },
                PATH = 'url', PORTS = (CLEAR) )
                FOR SOAP(
                [ { WEBMETHOD [ 'namespace' .] 'method_alias'
                (   NAME = 'database.owner.name'
                [ , SCHEMA = { NONE | STANDARD | DEFAULT } ]
                [ , FORMAT = { ALL_RESULTS | ROWSETS_ONLY } ])
                } [ ,...n ] ]
                [   BATCHES = { ENABLED | DISABLED } ]
                [ , WSDL = { NONE | DEFAULT | 'sp_name' } ]
                Let’s see how…

     Ver. 1.0                    Session 16               Slide 23 of 31
Querying and Managing Data Using SQL Server 2005
Just a minute


                While creating an HTTP Endpoint, which of the following
                format will you use to return only the result set to the user?
                 1. ROWSET_ONLY
                 2. ALL_RESULT
                 3. NONE




                Answer:
                 1. ROWSET_ONLY




     Ver. 1.0                       Session 16                         Slide 24 of 31
Querying and Managing Data Using SQL Server 2005
Demo: Implementing HTTP Endpoints


               • Problem Statement:
                    The database server of AdventureWorks, Inc. is located at
                    Bothell. The organization has various offices located at various
                    locations spread across the globe.
                    According to the requirements, the users need to access the
                    data of all the employees at various locations. Users might
                    need to use PDAs or mobile phones to access these details.
                    As a database developer, you have decided to implement a
                    Web service 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 16                           Slide 25 of 31
Querying and Managing Data Using SQL Server 2005
Demo: Implementing HTTP Endpoints (Contd.)


                Solution:
                   To solve the preceding problem, you need to perform the
                   following tasks:
                    1. Create a procedure.
                    2. Create an HTTP Endpoint for SOAP.
                    3. Verify the creation of HTTP endpoint. `




     Ver. 1.0                          Session 16                       Slide 26 of 31
Querying and Managing Data Using SQL Server 2005
Summary


               In this session, you learned that:
                  The database objects created in any of the .NET supported
                  languages are called managed database objects.
                  CLR integration provides the following benefits:
                    • Better programming model
                    • Common development environment
                    • Ability to define data types
                  T-SQL can be used to perform data access and manipulation
                  operations that can be implemented using the programming
                  constructs provided by T-SQL.




    Ver. 1.0                       Session 16                         Slide 27 of 31
Querying and Managing Data Using SQL Server 2005
Summary (Contd.)


               Managed database objects can be used in the following
               situations:
                   To implement complicated programming logic for which you can
                   reuse the functionality provided by the .NET base class libraries.
                   To access external resources, such as calling a Web service or
                   accessing the file system.
                   To implement a CPU-intensive functionality that can run more
                   efficiently as compared to the managed code.
               By default, the SQL Server does not allow running managed
               code on the server.
               Before creating a managed database object in your database,
               the CLR integration feature should be enabled in the database
               using the sp_configure stored procedure.
               The .NET code that is used to create the managed database
               objects is compiled in .NET assemblies, .dll or .exe files.
               To create a managed database object, first first the.NET
               assemblies are imported in the database engine.
    Ver. 1.0                      Session 16                                 Slide 28 of 31
Querying and Managing Data Using SQL Server 2005
Summary (Contd.)


               The assemblies in the database engine can be given any of the
               following three permissions:
                   SAFE
                   EXTERNAL_ACCESS
                   UNSAFE
               Managed stored procedure can be created using the CREATE
               PROCEDURE command.
               Managed function can be created using the CREATE
               FUNCTION command.
               Managed trigger can be created using the CREATE TRIGGER
               command.
               Managed data type can be created using the CREATE TYPE
               command.
               A Web service is the piece of code that is exposed over the
               Internet.


    Ver. 1.0                    Session 16                          Slide 29 of 31
Querying and Managing Data Using SQL Server 2005
Summary (Contd.)


               Web services have following advantages:
                • Interoperability
                • Multilanguage support
                • Reusing existing applications
               SOAP is a standard communication protocol to interchange
               information in a structured format in a distributed environment.
               WSDL is a markup language that describes a Web service.
               UDDI provides a standard mechanism to register and discover
               a Web service.
               HTTP endpoints allow you to create and use Web services
               within the SQL Server.
               Before creating an HTTP endpoint, you need to first create
               stored procedures or functions that form a Web service.




    Ver. 1.0                      Session 16                           Slide 30 of 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                   Session 16                          Slide 31 of 31

More Related Content

What's hot

Oracle Database Security For Developers
Oracle Database Security For DevelopersOracle Database Security For Developers
Oracle Database Security For Developers
Szymon Skorupinski
 
Ado.net session04
Ado.net session04Ado.net session04
Ado.net session04Niit Care
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3
IMC Institute
 
Ado.net session05
Ado.net session05Ado.net session05
Ado.net session05Niit Care
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
Dave Stokes
 
Advanced SQL injection to operating system full control (whitepaper)
Advanced SQL injection to operating system full control (whitepaper)Advanced SQL injection to operating system full control (whitepaper)
Advanced SQL injection to operating system full control (whitepaper)
Bernardo Damele A. G.
 
Android sql examples
Android sql examplesAndroid sql examples
Android sql examples
Aravindharamanan S
 
Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...
malu42
 
Reviewing sql server permissions tech republic
Reviewing sql server permissions   tech republicReviewing sql server permissions   tech republic
Reviewing sql server permissions tech republicKaing Menglieng
 
MSI Run-Time Logging and Debugging
MSI Run-Time Logging and DebuggingMSI Run-Time Logging and Debugging
MSI Run-Time Logging and Debugging
Flexera
 
Installing 12c R1 database on oracle linux
Installing 12c R1 database on oracle linuxInstalling 12c R1 database on oracle linux
Installing 12c R1 database on oracle linuxAnar Godjaev
 
Chapter6 database connectivity
Chapter6 database connectivityChapter6 database connectivity
Chapter6 database connectivity
KV(AFS) Utarlai, Barmer (Rajasthan)
 
Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)
Pini Dibask
 
3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks
Pramod Singla
 
android sqlite
android sqliteandroid sqlite
android sqliteDeepa Rani
 

What's hot (18)

SQL2SPARQL
SQL2SPARQLSQL2SPARQL
SQL2SPARQL
 
Oracle Database Security For Developers
Oracle Database Security For DevelopersOracle Database Security For Developers
Oracle Database Security For Developers
 
Ado.net session04
Ado.net session04Ado.net session04
Ado.net session04
 
Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3Java Web Programming Using Cloud Platform: Module 3
Java Web Programming Using Cloud Platform: Module 3
 
Ado.net session05
Ado.net session05Ado.net session05
Ado.net session05
 
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScriptJavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
JavaScript and Friends August 20th, 20201 -- MySQL Shell and JavaScript
 
Advanced SQL injection to operating system full control (whitepaper)
Advanced SQL injection to operating system full control (whitepaper)Advanced SQL injection to operating system full control (whitepaper)
Advanced SQL injection to operating system full control (whitepaper)
 
Android sql examples
Android sql examplesAndroid sql examples
Android sql examples
 
Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...Installing ingres enterprise access in a system which already has an ingres i...
Installing ingres enterprise access in a system which already has an ingres i...
 
181 Pdfsam
181 Pdfsam181 Pdfsam
181 Pdfsam
 
Reviewing sql server permissions tech republic
Reviewing sql server permissions   tech republicReviewing sql server permissions   tech republic
Reviewing sql server permissions tech republic
 
MSI Run-Time Logging and Debugging
MSI Run-Time Logging and DebuggingMSI Run-Time Logging and Debugging
MSI Run-Time Logging and Debugging
 
Ado.net
Ado.netAdo.net
Ado.net
 
Installing 12c R1 database on oracle linux
Installing 12c R1 database on oracle linuxInstalling 12c R1 database on oracle linux
Installing 12c R1 database on oracle linux
 
Chapter6 database connectivity
Chapter6 database connectivityChapter6 database connectivity
Chapter6 database connectivity
 
Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)Oracle database locking mechanism demystified (AOUG)
Oracle database locking mechanism demystified (AOUG)
 
3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks3.1\9 SSIS 2008R2_Training - ControlFlow asks
3.1\9 SSIS 2008R2_Training - ControlFlow asks
 
android sqlite
android sqliteandroid sqlite
android sqlite
 

Viewers also liked

Pymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junio
Pymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junioPymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junio
Pymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junio
Carmen Urbano
 
Ley general de educación panorama
Ley general de educación   panoramaLey general de educación   panorama
Ley general de educación panoramaandresienriquez
 
Internacionalizacion de la pyme via exportaciones por correos.
Internacionalizacion de la pyme via exportaciones por correos.Internacionalizacion de la pyme via exportaciones por correos.
Internacionalizacion de la pyme via exportaciones por correos.
JAIME ALBUJA
 
Mohammadzadeh's Portfoilo
Mohammadzadeh's PortfoiloMohammadzadeh's Portfoilo
Mohammadzadeh's PortfoiloMilud Zadeh
 
TTC Events Website
TTC Events WebsiteTTC Events Website
TTC Events Website
farhan mohammed
 
Informe auditoria externa concurrente agosto 2014 mayo 2015
Informe auditoria externa concurrente agosto 2014 mayo 2015Informe auditoria externa concurrente agosto 2014 mayo 2015
Informe auditoria externa concurrente agosto 2014 mayo 2015
Empresa de Servicios Sanitarios del Paraguay (ESSAP)
 
σχολικη βια
σχολικη βιασχολικη βια
σχολικη βια
dimitra krommyda
 
Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...
Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...
Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...
Carmen Urbano
 
Sea exaltado en el cielo
Sea exaltado en el cieloSea exaltado en el cielo
Sea exaltado en el cieloJose Cortes
 
How to Analyze, Measure and Optimize Non-Profit Websites
How to Analyze, Measure and Optimize Non-Profit WebsitesHow to Analyze, Measure and Optimize Non-Profit Websites
How to Analyze, Measure and Optimize Non-Profit Websites
Antoaneta Nikolaeva
 
Collection of Good Practices in Territorial Marketing, PADIMA European Project.
Collection of Good Practices in Territorial Marketing, PADIMA European Project.Collection of Good Practices in Territorial Marketing, PADIMA European Project.
Collection of Good Practices in Territorial Marketing, PADIMA European Project.Carmen Urbano
 
Turismo Territorial. Teruel (España) brochure
Turismo Territorial. Teruel (España) brochureTurismo Territorial. Teruel (España) brochure
Turismo Territorial. Teruel (España) brochure
Carmen Urbano
 
"La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent...
"La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent..."La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent...
"La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent...
Carmen Urbano
 
Web analytics and conversion optimization toolbox
Web analytics and conversion optimization toolboxWeb analytics and conversion optimization toolbox
Web analytics and conversion optimization toolbox
Antoaneta Nikolaeva
 
Comp tia n+_session_06
Comp tia n+_session_06Comp tia n+_session_06
Comp tia n+_session_06Niit Care
 

Viewers also liked (20)

Pymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junio
Pymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junioPymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junio
Pymes, transformación digital e internacionalizacion. CEEI Aragon - 8 junio
 
Estepona
EsteponaEstepona
Estepona
 
Ley general de educación panorama
Ley general de educación   panoramaLey general de educación   panorama
Ley general de educación panorama
 
Internacionalizacion de la pyme via exportaciones por correos.
Internacionalizacion de la pyme via exportaciones por correos.Internacionalizacion de la pyme via exportaciones por correos.
Internacionalizacion de la pyme via exportaciones por correos.
 
Zwa omadaa
Zwa omadaaZwa omadaa
Zwa omadaa
 
Mohammadzadeh's Portfoilo
Mohammadzadeh's PortfoiloMohammadzadeh's Portfoilo
Mohammadzadeh's Portfoilo
 
TTC Events Website
TTC Events WebsiteTTC Events Website
TTC Events Website
 
Informe auditoria externa concurrente agosto 2014 mayo 2015
Informe auditoria externa concurrente agosto 2014 mayo 2015Informe auditoria externa concurrente agosto 2014 mayo 2015
Informe auditoria externa concurrente agosto 2014 mayo 2015
 
Taller
TallerTaller
Taller
 
σχολικη βια
σχολικη βιασχολικη βια
σχολικη βια
 
Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...
Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...
Emprendedores e Internacionalización. Misión a Toulouse 26 y 27 de marzo. Zar...
 
Sea exaltado en el cielo
Sea exaltado en el cieloSea exaltado en el cielo
Sea exaltado en el cielo
 
How to Analyze, Measure and Optimize Non-Profit Websites
How to Analyze, Measure and Optimize Non-Profit WebsitesHow to Analyze, Measure and Optimize Non-Profit Websites
How to Analyze, Measure and Optimize Non-Profit Websites
 
Collection of Good Practices in Territorial Marketing, PADIMA European Project.
Collection of Good Practices in Territorial Marketing, PADIMA European Project.Collection of Good Practices in Territorial Marketing, PADIMA European Project.
Collection of Good Practices in Territorial Marketing, PADIMA European Project.
 
Ds 3
Ds 3Ds 3
Ds 3
 
Turismo Territorial. Teruel (España) brochure
Turismo Territorial. Teruel (España) brochureTurismo Territorial. Teruel (España) brochure
Turismo Territorial. Teruel (España) brochure
 
"La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent...
"La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent..."La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent...
"La internacionalizacion es responsabilidad de todos", por Carmen Urbano (ent...
 
Web analytics and conversion optimization toolbox
Web analytics and conversion optimization toolboxWeb analytics and conversion optimization toolbox
Web analytics and conversion optimization toolbox
 
Comp tia n+_session_06
Comp tia n+_session_06Comp tia n+_session_06
Comp tia n+_session_06
 
Portada
PortadaPortada
Portada
 

Similar to 11 qmds2005 session16

10 qmds2005 session14
10 qmds2005 session1410 qmds2005 session14
10 qmds2005 session14Niit Care
 
03 qmds2005 session03
03 qmds2005 session0303 qmds2005 session03
03 qmds2005 session03Niit Care
 
01 qmds2005 session01
01 qmds2005 session0101 qmds2005 session01
01 qmds2005 session01Niit Care
 
05 qmds2005 session07
05 qmds2005 session0705 qmds2005 session07
05 qmds2005 session07Niit Care
 
23 ijaprr vol1-3-25-31iqra
23 ijaprr vol1-3-25-31iqra23 ijaprr vol1-3-25-31iqra
23 ijaprr vol1-3-25-31iqra
ijaprr_editor
 
05 entity framework
05 entity framework05 entity framework
05 entity frameworkglubox
 
FREE Sql Server syllabus
FREE Sql Server syllabusFREE Sql Server syllabus
FREE Sql Server syllabus
Encryption Technology
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hydewebhostingguy
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developerswebhostingguy
 
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginnersSQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
Tobias Koprowski
 
13 qmds2005 session18
13 qmds2005 session1813 qmds2005 session18
13 qmds2005 session18Niit Care
 
Introduction to Threading in .Net
Introduction to Threading in .NetIntroduction to Threading in .Net
Introduction to Threading in .Netwebhostingguy
 
Session 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian MalbeufSession 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian Malbeuf
CTE Solutions Inc.
 
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale Webinar: Best Practices: Software Development Strategies Using Win...RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
Sankhya_Analytics
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
samtakke1
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity FrameworksRich Helton
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
Rajput Rajnish
 
SQL Server 2008 Security Overview
SQL Server 2008 Security OverviewSQL Server 2008 Security Overview
SQL Server 2008 Security Overviewukdpe
 

Similar to 11 qmds2005 session16 (20)

10 qmds2005 session14
10 qmds2005 session1410 qmds2005 session14
10 qmds2005 session14
 
03 qmds2005 session03
03 qmds2005 session0303 qmds2005 session03
03 qmds2005 session03
 
01 qmds2005 session01
01 qmds2005 session0101 qmds2005 session01
01 qmds2005 session01
 
05 qmds2005 session07
05 qmds2005 session0705 qmds2005 session07
05 qmds2005 session07
 
23 ijaprr vol1-3-25-31iqra
23 ijaprr vol1-3-25-31iqra23 ijaprr vol1-3-25-31iqra
23 ijaprr vol1-3-25-31iqra
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 
FREE Sql Server syllabus
FREE Sql Server syllabusFREE Sql Server syllabus
FREE Sql Server syllabus
 
Dr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. HydeDr. Jekyll and Mr. Hyde
Dr. Jekyll and Mr. Hyde
 
SQLCLR For DBAs and Developers
SQLCLR For DBAs and DevelopersSQLCLR For DBAs and Developers
SQLCLR For DBAs and Developers
 
Day2
Day2Day2
Day2
 
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginnersSQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
SQLSaturday#290_Kiev_WindowsAzureDatabaseForBeginners
 
13 qmds2005 session18
13 qmds2005 session1813 qmds2005 session18
13 qmds2005 session18
 
Introduction to Threading in .Net
Introduction to Threading in .NetIntroduction to Threading in .Net
Introduction to Threading in .Net
 
Session 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian MalbeufSession 2: SQL Server 2012 with Christian Malbeuf
Session 2: SQL Server 2012 with Christian Malbeuf
 
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale Webinar: Best Practices: Software Development Strategies Using Win...RightScale Webinar: Best Practices: Software Development Strategies Using Win...
RightScale Webinar: Best Practices: Software Development Strategies Using Win...
 
Getting Started with MySQL II
Getting Started with MySQL IIGetting Started with MySQL II
Getting Started with MySQL II
 
Microsoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptxMicrosoft SQL Server Database Administration.pptx
Microsoft SQL Server Database Administration.pptx
 
Sql Injection and Entity Frameworks
Sql Injection and Entity FrameworksSql Injection and Entity Frameworks
Sql Injection and Entity Frameworks
 
Rajnish singh(presentation on oracle )
Rajnish singh(presentation on  oracle )Rajnish singh(presentation on  oracle )
Rajnish singh(presentation on oracle )
 
SQL Server 2008 Security Overview
SQL Server 2008 Security OverviewSQL Server 2008 Security Overview
SQL Server 2008 Security Overview
 

More from Niit Care (20)

Ajs 1 b
Ajs 1 bAjs 1 b
Ajs 1 b
 
Ajs 4 b
Ajs 4 bAjs 4 b
Ajs 4 b
 
Ajs 4 a
Ajs 4 aAjs 4 a
Ajs 4 a
 
Ajs 4 c
Ajs 4 cAjs 4 c
Ajs 4 c
 
Ajs 3 b
Ajs 3 bAjs 3 b
Ajs 3 b
 
Ajs 3 a
Ajs 3 aAjs 3 a
Ajs 3 a
 
Ajs 3 c
Ajs 3 cAjs 3 c
Ajs 3 c
 
Ajs 2 b
Ajs 2 bAjs 2 b
Ajs 2 b
 
Ajs 2 a
Ajs 2 aAjs 2 a
Ajs 2 a
 
Ajs 2 c
Ajs 2 cAjs 2 c
Ajs 2 c
 
Ajs 1 a
Ajs 1 aAjs 1 a
Ajs 1 a
 
Ajs 1 c
Ajs 1 cAjs 1 c
Ajs 1 c
 
Dacj 4 2-c
Dacj 4 2-cDacj 4 2-c
Dacj 4 2-c
 
Dacj 4 2-b
Dacj 4 2-bDacj 4 2-b
Dacj 4 2-b
 
Dacj 4 2-a
Dacj 4 2-aDacj 4 2-a
Dacj 4 2-a
 
Dacj 4 1-c
Dacj 4 1-cDacj 4 1-c
Dacj 4 1-c
 
Dacj 4 1-b
Dacj 4 1-bDacj 4 1-b
Dacj 4 1-b
 
Dacj 4 1-a
Dacj 4 1-aDacj 4 1-a
Dacj 4 1-a
 
Dacj 1-2 b
Dacj 1-2 bDacj 1-2 b
Dacj 1-2 b
 
Dacj 1-3 c
Dacj 1-3 cDacj 1-3 c
Dacj 1-3 c
 

Recently uploaded

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
Peter Spielvogel
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
OnBoard
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Nexer Digital
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
UiPathCommunity
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
Thijs Feryn
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
91mobiles
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
Jemma Hussein Allen
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
Globus
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
Sri Ambati
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
UiPathCommunity
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
BookNet Canada
 

Recently uploaded (20)

By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdfFIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
FIDO Alliance Osaka Seminar: FIDO Security Aspects.pdf
 
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdfSAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
SAP Sapphire 2024 - ASUG301 building better apps with SAP Fiori.pdf
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
Leading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdfLeading Change strategies and insights for effective change management pdf 1.pdf
Leading Change strategies and insights for effective change management pdf 1.pdf
 
Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?Elizabeth Buie - Older adults: Are we really designing for our future selves?
Elizabeth Buie - Older adults: Are we really designing for our future selves?
 
UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..UiPath Community Day Dubai: AI at Work..
UiPath Community Day Dubai: AI at Work..
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
Accelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish CachingAccelerate your Kubernetes clusters with Varnish Caching
Accelerate your Kubernetes clusters with Varnish Caching
 
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdfSmart TV Buyer Insights Survey 2024 by 91mobiles.pdf
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf
 
The Future of Platform Engineering
The Future of Platform EngineeringThe Future of Platform Engineering
The Future of Platform Engineering
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Enhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZEnhancing Performance with Globus and the Science DMZ
Enhancing Performance with Globus and the Science DMZ
 
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
GenAISummit 2024 May 28 Sri Ambati Keynote: AGI Belongs to The Community in O...
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
Dev Dives: Train smarter, not harder – active learning and UiPath LLMs for do...
 
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...Transcript: Selling digital books in 2024: Insights from industry leaders - T...
Transcript: Selling digital books in 2024: Insights from industry leaders - T...
 

11 qmds2005 session16

  • 1. Querying and Managing Data Using SQL Server 2005 Objectives 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 Ver. 1.0 Session 16 Slide 1 of 31
  • 2. Querying and Managing Data Using SQL Server 2005 Introduction to SQL Server CLR Integration 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 Ver. 1.0 Session 16 Slide 2 of 31
  • 3. Querying and Managing Data Using SQL Server 2005 Identifying the Need for Managed Code 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. Ver. 1.0 Session 16 Slide 3 of 31
  • 4. 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 Ver. 1.0 Session 16 Slide 4 of 31
  • 5. Querying and Managing Data Using SQL Server 2005 Importing and Configuring Assemblies 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… Ver. 1.0 Session 16 Slide 5 of 31
  • 6. 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 Ver. 1.0 Session 16 Slide 6 of 31
  • 7. Querying and Managing Data Using SQL Server 2005 Creating Managed Database Objects Managed database objects can be of the following types: Stored Procedures Functions Triggers UDTs Ver. 1.0 Session 16 Slide 7 of 31
  • 8. Querying and Managing Data Using SQL Server 2005 Creating Managed Database Objects (Contd.) 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… Ver. 1.0 Session 16 Slide 8 of 31
  • 9. Querying and Managing Data Using SQL Server 2005 Creating Managed Database Objects (Contd.) 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… Ver. 1.0 Session 16 Slide 9 of 31
  • 10. Querying and Managing Data Using SQL Server 2005 Creating Managed Database Objects (Contd.) 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… Ver. 1.0 Session 16 Slide 10 of 31
  • 11. Querying and Managing Data Using SQL Server 2005 Creating Managed Database Objects (Contd.) Managed user-defined type: Is created by using the CREATE TYPE command Syntax: CREATE TYPE [ schema_name. ] type_name { FROM base_type [ (precision [ , scale ] ) ] [ NULL | NOT NULL ] | EXTERNAL NAME assembly_name[.class_name] } Let’s see how… Ver. 1.0 Session 16 Slide 11 of 31
  • 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 16 Slide 12 of 31
  • 13. Querying and Managing Data Using SQL Server 2005 Demo: Implementing Managed User-Defined Types • Problem Statement: The management of AdventureWorks, Inc. has decided that they want to include the details of the spouse of employees in the database. The application that is used to enter the employee detail will accept the name and date of birth of the spouse of an employee. In addition, it will concatenate the two values separated by a ";". As a database developer, you need to store the spouse details in the following format: Spouse Name: <name of the spouse> ; Spouse Date of Birth : <date of birth> To implement this, you have decided to create a managed user-defined data type. How will you create this data type? Ver. 1.0 Session 16 Slide 13 of 31
  • 14. Querying and Managing Data Using SQL Server 2005 Demo: Implementing Managed User-Defined Types (Contd.) Solution: To solve the preceding problem, you need to perform the following tasks: 1. Enable CLR in the database. 2. Create an assembly. 3. Create a managed database user-defined data type. 4. Create a table that will implement the user-defined data type. 5. Verify the output. Ver. 1.0 Session 16 Slide 14 of 31
  • 15. Querying and Managing Data Using SQL Server 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 Session 16 Slide 15 of 31
  • 16. Querying and Managing Data Using SQL Server 2005 Introduction to Web Services Flash presentation: Introduction to Web Services Web Service is a collection of methods that provide programmable logic used by client applications over the Internet. SQL Server 2005 provides native XML Web services by using the following open standards: Hypertext Transfer Protocol (HTTP) Simple Object Access Protocol (SOAP) Web Services Definition Language (WSDL) Ver. 1.0 Session 16 Slide 16 of 31
  • 17. Querying and Managing Data Using SQL Server 2005 Just a minute Which of the following describes the Web services? 1. WSDL 2. SOAP 3. UDDI Answer: 1. WSDL Ver. 1.0 Session 16 Slide 17 of 31
  • 18. Querying and Managing Data Using SQL Server 2005 Just a minute Which of the following helps in finding a Web service? 1. WSDL 2. SOAP 3. UDDI Answer: 3. UDDI Ver. 1.0 Session 16 Slide 18 of 31
  • 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 with SQL Server 2005 can listen and receive requests on the TCP port (port 80) Ver. 1.0 Session 16 Slide 19 of 31
  • 20. Querying and Managing Data Using SQL Server 2005 Identifying the Role of HTTP Endpoints in Native Web Service Architecture (Contd.) HTTP Endpoint Architecture: Ver. 1.0 Session 16 Slide 20 of 31
  • 21. Querying and Managing Data Using SQL Server 2005 Just a minute On which of the following ports does the SQL Server listen for HTTP requests? 1. 80 2. 90 3. 70 Answer: 1. 80 Ver. 1.0 Session 16 Slide 21 of 31
  • 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. Ver. 1.0 Session 16 Slide 22 of 31
  • 23. Querying and Managing Data Using SQL Server 2005 Creating HTTP Endpoints (Contd.) Syntax: CREATE ENDPOINT endpoint_name STATE = { STARTED | STOPPED | DISABLED } AS HTTP ( AUTHENTICATION =( { BASIC | DIGEST | INTEGRATED | NTLM | KERBEROS }, PATH = 'url', PORTS = (CLEAR) ) FOR SOAP( [ { WEBMETHOD [ 'namespace' .] 'method_alias' ( NAME = 'database.owner.name' [ , SCHEMA = { NONE | STANDARD | DEFAULT } ] [ , FORMAT = { ALL_RESULTS | ROWSETS_ONLY } ]) } [ ,...n ] ] [ BATCHES = { ENABLED | DISABLED } ] [ , WSDL = { NONE | DEFAULT | 'sp_name' } ] Let’s see how… Ver. 1.0 Session 16 Slide 23 of 31
  • 24. Querying and Managing Data Using SQL Server 2005 Just a minute While creating an HTTP Endpoint, which of the following format will you use to return only the result set to the user? 1. ROWSET_ONLY 2. ALL_RESULT 3. NONE Answer: 1. ROWSET_ONLY Ver. 1.0 Session 16 Slide 24 of 31
  • 25. Querying and Managing Data Using SQL Server 2005 Demo: Implementing HTTP Endpoints • Problem Statement: The database server of AdventureWorks, Inc. is located at Bothell. The organization has various offices located at various locations spread across the globe. According to the requirements, the users need to access the data of all the employees at various locations. Users might need to use PDAs or mobile phones to access these details. As a database developer, you have decided to implement a Web service 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 16 Slide 25 of 31
  • 26. Querying and Managing Data Using SQL Server 2005 Demo: Implementing HTTP Endpoints (Contd.) Solution: To solve the preceding problem, you need to perform the following tasks: 1. Create a procedure. 2. Create an HTTP Endpoint for SOAP. 3. Verify the creation of HTTP endpoint. ` Ver. 1.0 Session 16 Slide 26 of 31
  • 27. Querying and Managing Data Using SQL Server 2005 Summary In this session, you learned that: The database objects created in any of the .NET supported languages are called managed database objects. CLR integration provides the following benefits: • Better programming model • Common development environment • Ability to define data types T-SQL can be used to perform data access and manipulation operations that can be implemented using the programming constructs provided by T-SQL. Ver. 1.0 Session 16 Slide 27 of 31
  • 28. Querying and Managing Data Using SQL Server 2005 Summary (Contd.) Managed database objects can be used in the following situations: To implement complicated programming logic for which you can reuse the functionality provided by the .NET base class libraries. To access external resources, such as calling a Web service or accessing the file system. To implement a CPU-intensive functionality that can run more efficiently as compared to the managed code. By default, the SQL Server does not allow running managed code on the server. Before creating a managed database object in your database, the CLR integration feature should be enabled in the database using the sp_configure stored procedure. The .NET code that is used to create the managed database objects is compiled in .NET assemblies, .dll or .exe files. To create a managed database object, first first the.NET assemblies are imported in the database engine. Ver. 1.0 Session 16 Slide 28 of 31
  • 29. Querying and Managing Data Using SQL Server 2005 Summary (Contd.) The assemblies in the database engine can be given any of the following three permissions: SAFE EXTERNAL_ACCESS UNSAFE Managed stored procedure can be created using the CREATE PROCEDURE command. Managed function can be created using the CREATE FUNCTION command. Managed trigger can be created using the CREATE TRIGGER command. Managed data type can be created using the CREATE TYPE command. A Web service is the piece of code that is exposed over the Internet. Ver. 1.0 Session 16 Slide 29 of 31
  • 30. Querying and Managing Data Using SQL Server 2005 Summary (Contd.) Web services have following advantages: • Interoperability • Multilanguage support • Reusing existing applications SOAP is a standard communication protocol to interchange information in a structured format in a distributed environment. WSDL is a markup language that describes a Web service. UDDI provides a standard mechanism to register and discover a Web service. HTTP endpoints allow you to create and use Web services within the SQL Server. Before creating an HTTP endpoint, you need to first create stored procedures or functions that form a Web service. Ver. 1.0 Session 16 Slide 30 of 31
  • 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 Session 16 Slide 31 of 31

Editor's Notes

  1. Start the session by sharing the objectives with the students.
  2. In this slide, you need to explain the students about CLR. As they have already read about CLR in the previous module, you need not to go into the details of CLR. In addition, you also need to explain them that CLR has now been incorporated in the SQL Server itself. Also explain the students about 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. Additional Inputs 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.
  3. In this slide, 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 the introducing managed code in SQL Server. Additional Input T-SQL is a great language to manipulate and query data from a database server, and working on set-based operations. It provides a number of database features
  4. Example: You have created a managed code and saved it as CLRIntegration.dll. To create an assembly for this dll, you can write the following code: CREATE ASSEMBLY CLRIntegration FROM ‘ C:\\CLRIntegration\\CLRIntegration.dll’ WITH PERMISSION_SET = SAFE
  5. For example, the employees data stored in the database need to be converted into an XML file. For this purpose, you need to create a function that will read the data from the table and write it inside the XML file. As you need to access an external file, you need to create a managed procedure.
  6. For Example, you need a function that accepts Employee Id as an input, does all the processing, and finally displays the actual salary of that employee for current month. The processing includes, adding all the components of the salary, checking and adjusting the salary according to the attendance, and deducting the provident fund contribution. Writing this code in T-SQL is very complicated, as it involves a number of decisions and a number of processing. You can create a managed function that accepts employee code and returns the actual salary.
  7. For Example, you want that whenever a new database object is added in the AdventureWorks database, the same should be added in the list of the database objects available with the database administrator. The list of database objects is stored in a text file with the DBA.
  8. For Example, You need to create a data type to store the zip code of addresses of the employees. You also want if user enters valid code, the name of the state is stored in the column else an error message should be displayed. Creating such a UDT is very complicated in SQL Server, for this purpose you will create a Managed UDT.
  9. Do not go into the depth of SOAD, WSDL, and UDDI. Just try to clear the concept of Web Services to the student.
  10. Example: You have created a function that returns the day as number. To create a new endpoint named sqlEndpoint, you need to use the following code in SQL Server. CREATE ENDPOINT sql_endpoint STATE = STARTED AS HTTP( PATH = &apos;/sql&apos;, AUTHENTICATION = (INTEGRATED ), PORTS = ( CLEAR ), SITE = &apos;SERVER&apos; ) FOR SOAP ( WEBMETHOD &apos;GetSqlInfo&apos; (name=&apos;master.dbo.xp_msver&apos;, SCHEMA=STANDARD ), WEBMETHOD &apos;DayAsNumber&apos; (name=&apos;master.sys.fn_MSdayasnumber&apos;), WSDL = DEFAULT, SCHEMA = STANDARD, DATABASE = &apos;master&apos;, NAMESPACE = &apos;http://tempUri.org/&apos; );
  11. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  12. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  13. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.
  14. You can summarize the session by running through the summary given in SG. In addition, you can also ask students summarize what they have learnt in this session.