Welcome to Sign in | Help
in Search

dynamic management object

Last post 12-05-2006, 7:51 PM by xmldeveloper. 3 replies.
Sort Posts: Previous Next
  •  12-05-2006, 8:48 AM 1197

    dynamic management object

    Ar putea cineva sa explice utilitatea acestui concept,cand anume sa foloseste eventual niste exemple simple?

    Multumesc


    Secolul XXI ori va fi religios ori nu va fi deloc
    Filed under:
  •  12-05-2006, 10:17 AM 1199 in reply to 1197

    Re: dynamic management object

    Dynamic Management Objects (Dynamic Management Views si Dynamic Management Functions) sunt view-uri si functii care expun informatii despre starea curenta a serverului. De exemplu conexiunile curente, sesiunile curente, tranzactiile etc.

    Un articol introductiv pe tema aceasta gasiti chiar pe forum: Dynamic Management Views and Functions – Pain-free Introduction


    Cristian Andrei Lefter, SQL Server MVP
    MCT, MCSA, MCDBA, MCAD, MCSD .NET,
    MCTS, MCITP - Database Administrator SQL Server 2005
    http://sqlserver.ro
  •  12-05-2006, 7:12 PM 1213 in reply to 1199

    Re: Dynamic Management Views and Functions – Pain-free Introduction

    Ca sa va cicalesc din nou Big Smile cross apply operatorul asta ce face l-ati folosit e eficient ?
    Secolul XXI ori va fi religios ori nu va fi deloc
  •  12-05-2006, 7:51 PM 1215 in reply to 1213

    Re: Dynamic Management Views and Functions – Pain-free Introduction

    Operatorul APPLY

     

    Operatorul APPLY (similar unui CROSS JOIN) permite pentru fiecare rand al unui tabel invocarea unei table expression (expresie tabelara) gen tabel, view, tabel derivat sau functii tip table-valued (functia returneaza un tabel).

    Exista doua forme:

    §          CROSS APPLY – un rand din tabelul caruia i se aplica operatorul este inclus in rezultat doar daca expresia tabelara returneaza rezultate pentru acel rand

    §          OUTER APPLY – toate randurile din tabelul caruia i se aplica operatorul

     

    Sintaxa:

    FROM left_table_source

    {OUTER | CROSS} APPLY right_table_source

     

    Exemplu:

    USE AdventureWorks;

    GO

    -- functia OrdineRecente returneaza ultimele

    -- doua ordine pentru un client

    CREATE FUNCTION Sales.OrdineRecente(@CustomerID int)

    RETURNS TABLE AS

    RETURN   

    SELECT TOP (2) SalesOrderID, OrderDate   

    FROM Sales.SalesOrderHeader   

    WHERE CustomerID = @CustomerID   

    ORDER BY OrderDate DESC

    GO

     

    -- exemplu CROSS APPLY

    SELECT        S.[Name] as Customer,

    O.SalesOrderID, O.OrderDate

    FROM Sales.Store S

    CROSS APPLY

    Sales.OrdineRecente(CustomerID) AS O

     

    -- exemplu OUTER APPLY

    SELECT        S.[Name] as Customer,

    O.SalesOrderID, O.OrderDate

    FROM Sales.Store S

    OUTER APPLY

    Sales.OrdineRecente(CustomerID) AS O


    Cristian Andrei Lefter, SQL Server MVP
    MCT, MCSA, MCDBA, MCAD, MCSD .NET,
    MCTS, MCITP - Database Administrator SQL Server 2005
    http://sqlserver.ro
View as RSS news feed in XML
Powered by Community Server (Commercial Edition), by Telligent Systems