2010-10-06 6 views
5

Witam Próbuję utworzyć raport, który zawiera listę wszystkich subskrypcji na naszym serwerze raportów, raport, w którym się znajdują, godziny i dni, w których są uruchomione, oraz reccurence. Do tej pory udało mi się uzyskać listę raportów i harmonogramów raportów. Nie mogę zrozumieć, co oznaczają wartości i kolumny w tabeli Harmonogram.Sprawdzanie tabeli ReportServer.dbo.Schedule

Jeśli ktoś mógłby rzucić trochę światła na to, jak zrozumieć te kolumny i ich wartości, byłbym bardzo wdzięczny. To jest moje dotychczasowe zapytanie.

USE ReportServer;
GO

SELECT Users.UserName
, c.Name AS Raport
, Subscriptions.Description
, Schedule. *
/*, Schedule.RecurrenceType
, Schedule.MinutesInterval
, Schedule. DaysInterval
, Schedule.WeeksInterval
, Schedule.DaysOfWeek
, Schedule.DaysOfMonth
, Schedule. [Miesiąc]
, Schedule.MonthlyWeek */
FROM [katalog] AS c
INNER JOIN subskrypcje
NA c.ItemId = Subscriptions.Report_OId
INNER JOIN Użytkownicy
NA Subscriptions.OwnerId = Users.UserId
INNER JOIN ReportSchedule
NA Subscriptions.SubScriptionId = ReportSchedule.SubScriptionId
INNER JOIN Harmonogram
NA ReportSchedule.ScheduleId = Schedule.Sch eduleId

Dzięki
Chris

Odpowiedz

1

Oto częściowa odpowiedź ...

DaysOfWeek odnoszą się do ustawienia binarnym gdzie:

niedziela jest bit 0: Wartość 1 poniedziałek jest nieco 1: Wartość 2 Wtorek jest bitem 2: Wartość 4 Środa jest bitem 3: Wartość 8 Czwartek to bit 4: Wartość 16 Piątek to bit 5: Wartość 32 sobota jest bit 6: Wartość 64

Więc jeśli raport jest uruchamiany w każdy poniedziałek i środę DaysOfWeek będzie 2 + 8 lub 10.

Obecnie pracuję na ten sam więc dodam do tego, ponieważ odkrywam więcej.

1

Mam rozwiązanie tego problemu, gdy nadesłałem raport, który piszę.

create function [dbo].[calendarlist](@Value_in as int,@Type as int) returns varchar(200) 
as 
begin 

/* 
This code is to work out either the day of the week or the name of a month when given a value 
Wrriten by S Manson. 
31/01/2012 
*/ 

declare @strings as varchar(200) 
declare @Count int 

if @Type = 2 --Months 
    Begin 
     set @Count =12 
    end 
else if @Type = 1 --Days of Week 
    Begin 
     Set @Count = 7 
    End 
else --Days of Month 
    Begin 
     Set @Count = 31 
    End 

set @strings = '' 

while @Count<>0 
begin 
    if @Value_in>=(select power(2,@count-1)) 
     begin 
      set @Value_in = @Value_in - (select power(2,@count-1)) 
      If @Type=2 
       Begin 
        set @strings = (SELECT DATENAME(mm, DATEADD(month, @count-1, CAST('2008-01-01' AS datetime)))) + ',' + @strings 
       end 
      else if @Type = 1 
       begin 
        set @strings = (SELECT DATENAME(dw, DATEADD(day, @count-1, CAST('2012-01-01' AS datetime)))) + ',' + @strings 
       end 
      else 
       begin 
        set @strings = convert(varchar(2),@Count) + ', ' + @strings 
       end 

     end 
    set @count = @count-1 
end 
if right(@strings,1)=',' 
    set @strings = left(@strings,len(@strings)-1) 

return @strings 

end 
Powiązane problemy