????? ????? ????? ????? ??? ????? ???? ???? ??? ?? Systems Management Server 2003

?????? ????????? ?????? ?????????
???? ???????: 886011 - ??? ???????? ???? ????? ????? ??? ???????.
????? ???? | ?? ????

????? ???

???? ??? ??????? ????? ????? ????? ????? ??? ????? ???? ???? ??? ?? Microsoft Systems Management Server (SMS) 2003.

??????? ????

????? ??????? ????? SQL ????? ?????? ????? ??? ??????? ???? ???? ????? ??? ???? ????? ??? ?????? ?? ??? ??????. ?????? ????? ???? ??????? ???????:
  1. ??? ???? ???? ????? SMS.
  2. ????? ????? ?????? ?????? (site_code - site_name).
  3. ?? ?????? ???????.
  4. ???? ??? ?????? ?????? ??? ?????? ? ??? ??? ???? ?? ???? ??? ?????.
  5. ?? ???? ?????? ????? ????? ???? ????? ?? ?????? ??? ? ??? ???? SMS ? ??? ?? ??????? ??? ? ?? ???? ??? ????? ????? SQL.
  6. ???? ???????? ???????? ??????? ??? SQL ????? ?????? ?? ???? ??? ?????.

    ?????? ??? ????? ?????? ?????? ?? ?????? ???? SQL ??? ????? ??????? ????????? ????????.
    /* Sites in an SMS hierarchy can be listed in hierarchy order with indentation to show */
    /* the site's depth in the hierarchy by using the following code sample in the Web     */
    /* report definition.  If a hierarchy has 7 sites that include AAA as a central site,  */
    /* BBB and CCC as primary sites under the central site, with DDD and EEE as secondary  */
    /* sites of BBB and FFF and GGG as secondary sites of CCC, the report will print the   */
    /* following:                                                                          */
    /*                                                                                     */
    /* SiteCode   Level  SiteName   ServerName                                             */
    /* ---------  -----  --------   ----------                                             */
    /* AAA        1      Site A     SERVER_A                                               */
    /*    BBB     2      Site B     SERVER_B                                               */
    /*       DDD  3      Site D     SERVER_D                                               */
    /*       EEE  3      Site E     SERVER_E                                               */
    /*    CCC     2      Site C     SERVER_C                                               */
    /*       FFF  3      Site F     SERVER_F                                               */
    /*       GGG  3      Site G     SERVER_G                                               */
    /*                                                                                     */
    /* You can see a demonstration of this in the SMS 2003 report                          */
    /*   "Site by hierarchy with time of last site status update."                         */
    
    set nocount on
    
    /* create a temporary table to hold the ordering information */
    
    create table #SiteOrder
    (
      SiteCode char(3),
      Level    int, /* depth in hierarchy, 1 = centeral site */
      PreOrder int identity, /* ordering for hierarchy order */
      PRIMARY KEY (Level,SiteCode)
    )
    
    declare @NextS char(3)
    declare @Level int
    
    set @Level=1
    set @NextS=''
    
    /* do a depth first walk of the hierarchy tree, listing the sites in pre-order */
    
    while @NextS is not null
    begin
       select @NextS=MIN(SiteCode) from v_Site where ReportingSiteCode=@NextS
         and SiteCode not in (select SiteCode from #SiteOrder where Level=@Level)
    
       if @NextS IS NULL
       begin
          set @Level=@Level-1
          select @NextS = MAX(SiteCode) from #SiteOrder where Level=@Level-1
       end
       else 
       begin
          insert into #SiteOrder(SiteCode,Level) values(@NextS,@Level)
          set @Level = @Level + 1
       end  
    end
      
    /* This is a sample query using the #SiteOrder table to list the sites in the v_Site view */
    /* in hierarchy order. Other queries can be listed in hierarchy order by joining to the   */
    /* #SiteOrder table by SiteCode and ordering by PreOrder. Use the Level column with the   */
    /* SPACE() function to provide indentation.                                               */
    
    select SPACE(3*(so.Level-1))+so.SiteCode as SiteCode, so.Level, s.SiteName, s.ServerName
    from #SiteOrder so
    join v_Site s on so.SiteCode=s.SiteCode
    order by so.PreOrder
    
    /* drop the temporary table at the end */
    
    drop table #SiteOrder
    
    set nocount off
    
  7. ???? ??? ?????? ?????? ??? ????? ????????? ? ??? ??? ???? ?? ???? ??? ???? ?????????.
  8. ?? ????? ??????? ??? ?? ???? ?????? ????? ???? ????????? ???? ??? ????? ?? ?????? ?????.
  9. ?? ???? ?????? "????? ???? ?????????" ? ???? ??? ????? ??????? ?????? ???? ??? ?????? ?????? ??? ?? ?? ????? ???? ????????? ?? ???? ??? ?????.
  10. ?? ???? ?????? "????? ?????" ? ???? ?????? ??????? ???? ??? ??????? ?? ?????? 9 ?? ???? ??? ????? ?????.
  11. ???? ??? ?????? ?????? ??? ???? ????? ?????? ??????? ???? ??? ??????? ?? ?????? 7 ??? ??? ???? ?????? ??? ??? ????? ? ?? ???? ??? ??? ??????. ????? ??? ???? ??????? ??? ??????? ???? ???? ????? ??? ???? ????? ??? ?????? ?? ??? ??????.

???????

???? ???????: 886011 - ????? ??? ??????: 05/????/1427 - ??????: 1.2
????? ???
  • Microsoft Systems Management Server 2003 Enterprise Edition
????? ??????: 
kbmt kbsmsreporting kbsmsadmin kbcode kbhowto KB886011 KbMtar
????? ????
???: ??? ????? ??? ?????? ???????? ?????? ????? ???? ????? ?????????? ????? ?? ????????? ?????? ????. ???? ???? ?????????? ???? ?? ???????? ???????? ?????? ????????? ????? ????????? ???????? ????? ???????? ?????? ?? ?????? ??? ?? ???????? ???????? ?? ????? ??????? ?????? ??? ??????? ?????? ??. ?????? ?? ???? ??? ??????? ???????? ????? ?? ???? ????? ?????? ??? ????? ??? ????? ??????? ?? ????? ?? ?????? ??? ??? ??????? ??????? ?? ????? ????? ????? ????? ?????. ?? ????? ???? ?????????? ??????? ??? ????? ?? ??????? ?? ????? ?????? ?? ??? ????? ?? ????? ??????? ?? ???????? ?? ??? ???????. ???? ???? ?????????? ???????? ??? ????? ?????? ??????? ??????
???? ??? ????? ??????? ?????? ??????????886011

????? ???????

 

Contact us for more help

Contact us for more help
Connect with Answer Desk for expert help.
Get more support from smallbusiness.support.microsoft.com