SSRS Slow Waking Up On First Report

Jan 8, 2007



Greetings,

I continue to see this similar post all over the place, but no resolutions.

We have SSRS installed and operational in production. There are reports that get accessed from either an aspx page or from the built in IIS site for SSRS.

First time access is the performance problem. Here are two scenarios:

1) from your browser, pull up the front page to SSRS: http://myserver/reports. This simple operation will take about 2 minutes to come up. Drill to the report in question and it runs fairly well first time through. Throw a different query at it and it runs faster. If you wait a while (maybe 15 minutes +) the whole thing will spin back down and take 2 minutes to come up again. If you exit the website and come back immediately, everything still stays quick.

2) from an aspx page, same thing... if the service is spun down, the end user will typically get tired of waiting or timeout. Once everything is spun up, the process runs fine.

We setup another report that just does some simple statistics and added in a timed subscription for every 15 minutes hoping it would keep the service up and running.... no joy. Still the same.

Also adjusted the app pool to about every option to see if we could keep it running, but no joy.

====

So -- any ideas? Forget about running a report.... just think about pulling the website up. 2 minutes to get it to display in the browser the first time...

arghhhhhh

Thanks in advanced.



Dan Ribar

View 8 Replies


ADVERTISEMENT

Reporting Services :: SSRS Report Very Slow In Report Server?

Oct 21, 2015

I have a report which works fine with visual studio but when i uploaded the same into report server and tries to access it through IE or chrome or anything its dam slow.

how to get rid of this issue?

View 4 Replies View Related

Reporting Services :: SSRS Report Run Very Slow Using Mdx In Cube On SharePoint 2013

Nov 21, 2015

I have developed the SSRS report and  deployed them on SharePoint 2013 BUt when I run report  through  broswer It take long time to execute.

View 3 Replies View Related

SSRS Website Slow When Accessing It The First Time After Inactivity

May 23, 2008

The SSRS website is slow when accessing it the first time after a period of inactivity (30 min. or longer). What could be causing this and how can I make it fast all the time.

View 1 Replies View Related

SSRS 2005 With Remote Catalog Very Slow - Any Ideas?

Nov 6, 2007



Hi,

Just wondering if anybody has any idea why when using RS 2005, remote catalog, asp.net 2.0 and using the .net 2.0 reportviewer control on an aspx page it seem to run 15 - 20 times slower than if we use a local catalog. The two machine in the remote catalog setup have a 2gb network connect between them, the doesn't apear to be any network load on either machine.

Any ideas will be greatfully received.

Cheers

Jon

View 1 Replies View Related

Reporting Services :: Domain User - Unable To Run Report In SSRS Report Manager?

Oct 9, 2015

I have done the following and a domain user would not access report created a login to the SQL server to the user (this SQL Server is where data source DB is)went to site setting in Report Manager and made this use a system userright clicked on report folder and made this user in the browser roleeven checked that in the report in question, the user is already in the browser role Still the user would not access the report! "User .......... does not have required permission" is the error message I am getting. 

View 6 Replies View Related

Reporting Services :: SSRS Report Runs In Visual Studio But Not Report Manager

Jul 5, 2012

I have written a report visual studio.  The report has 10 multi-value parameters that pull data from their individual data sets within the reports.  When running the report from within Visual Studio it renders fine.  There are no errors reported, only a warning related to a pathname I have use to retrieve image data and display on the report.Deployment of the report is error free.When I view the report I briefly get the "Loading" splash window, but then nothing.  None of the headers or static text is displayed.  The results window is blank.

The report defaults all the parameter values.  In trying to debug the issue I have found by reducing the number of parameter values the report will render.  Once I have all the values added, the report does nothing.Below is the query being used for the report.  The where clause in the query shows the parameters being used and the syntax.We are running on Windows Server 2008 R2 and SQL Server 2008 R2.

Ralph
SELECT RTRIM(a.ITEMNMBR) AS Style, RTRIM(a.ITEMDESC) AS Description, a.ITMSHNAM AS UPC, c.LOCNCODE AS Store, d.LISTPRCE AS ListPrice, a.CURRCOST AS Cost,
a.USCATVLS_1 AS [Main Category], a.USCATVLS_2 AS Market, a.USCATVLS_3 AS [Alternate Retail], a.USCATVLS_4 AS Country, b.ITEMXTRAS_1_Type AS Type,
b.ITEMXTRAS_2_Finish AS Finish, b.ITEMXTRAS_3_SubCategory AS SubCategory, b.ITEMXTRAS_4_Department AS Department,

[code]...

View 7 Replies View Related

Reporting Services :: SSRS Report Export In Excel To 2 Pages Where Have 2 Tables In Report

Sep 21, 2015

I have a ssrs report having 2 tables in with 4 columns in each. When I go to export option in preview I can see all data coming in one excel sheet, But I am trying to get 2 tables in 2 different pages in Excel when I export.First page of excel comes with first table data with 4 columns and second page of excel comes with second table data with 4 columns .

View 2 Replies View Related

Passing Report Parameters To An SSRS 2005 Report Hosted In Sharepoint 2007

Nov 18, 2007

Here is a situation in my company:

We have an Office SharePoint 2007 site, we developed a couple of web parts and added them to our site. We used SQL Server Reporting services 2005 as our reporting solution. The reports are hosted on the report center and when we need a report, we open it by sending a URL requesting the report, passing the report parameters in the URL query string. So the report is filtered based on the parameters passed from the web parts.

But since best practices say that you should host reports directly under SharePoint, by configuring the reporting services to run in the SharePoint integrated mode. We followed the steps and installed SharePointRS and we finally succeeded to publish the reports to a SharePoint folder, but we had a limitation: we are unable to pass the report parameters internally to the report hosted in SharePoint. If we passed them in the query string as the report center case, SharePoint neglects them totally.
So the question is: how can I pass parameters internally between a SharePoint web part and a SQL server 2005 reporting services report hosted in SharePoint?

View 1 Replies View Related

Reporting Services :: SSRS / How To Print A Report Without Bringing Up The Rendered Report

Jun 29, 2015

I'm wondering how to print a SSRS report without bringing up a report viewer. Is there way to print(PDF format) the SSRS report in the web application( .net )  directly from the "print" button without bringing up a report viewer?

View 2 Replies View Related

SSRS Report Generator Hangs On Execution In BIDS And Report Manager

Apr 29, 2008

Hi,

I'm encounter lately some weird behaviour of SSRS in BIDS as well as after deploying on Reporting Server.
I'm running basic classical SQL SSRS Reports with Oracle DB connection. My reports have header and footer pagination and well defined report layer configuration. All the reports are simple based on one table and some basic parameters passed to query.

In query builder from BIDS from data tab, the query is running fine without any other execution delays. Also the query is runnign fine in PL/Dev environment.
When I switch in "Preview" mode the report hangs in execution and just showing "Report is being generated" without any resuts. After a while is generating an execution error (after 20 min).

The behaviour is the same after deployment on Report Server .
I now...here it comes...the problem is intermitent...some times the report is working...but most of the times it hangs on execution.
I checked the report from top to bottom and nothing's wrong from design perspective.

On other reports I don't have this problem and I don't understand where to start to investigate.

Any suggestions...I'm stuck here.

Thanks

View 1 Replies View Related

Reporting Services :: Passing Cascaded Parameters From Main Report To Drill Through Report In SSRS?

Sep 16, 2015

I am trying to develop a report from cube,and it has one drill through report.when i click on sales amount field on main report,then it open the drill through report with details.Here i passed the **(category,subcat,product)parameters(Cascaded)** to drill through report in action part of main report.In my main report i have two columns .

columns are **Level**  and              **Salesamount**.  

Values are like  

**[-]category**              **100**
    **[-]subcat**             **50**
         **product**          **30**

when i click on 100, parameters are passed & it open the detail report correctly, but when i click on 50,the values for subcat parameter is not getting values in detail report and same as the product also.

Here i used the expressions in parameter values

**pCategory**----iif(inscope(category),!fields.category.value,split(join(Parameters!category.value,","),","))

**psubcat**----iif(inscope(subcat),!fields.subcat.value,split(join(Parameters!subcat.value,","),","))

**pproduct**----iif(inscope(product),!fields.product.value,split(join(Parameters!product.value,","),","))

View 3 Replies View Related

Reporting Services :: SSRS Linked Report Based On Calculated Field From Main Report

Oct 6, 2015

How do I get data on my linked report based on my grouped subtotal and grand total from the main report.  The subtotal and grand total are calculated columns.

I have a 3 columns in my matrix in the SSRS summary report. Actn_COAST, ActnCITY and NumbOfAccts.  

The following is code for my summary report.  The results are shown below.

SELECT Distinct ActnCITY, Count(ACCT) as NumbOfAccts,
CASE WHEN ActnCITY in ('NY', 'OH', IN, 'NJ', 'SC', 'NC') THEN 'EAST COAST'
WHEN ActnCITY IN ('CA'. 'NV', 'UT', 'WA', 'OR') THEN 'WEST COAST'
ELSE 'OTHER'
END AS Actn_COAST

FROM tbl1
where ACTNDATE between @STARTDT and @EndDT

Code for my detail report contains the following SQL

SELECT * FROM tbl1 where ACTNDATE between @STARTDT and @EndDT AND @ActnCITY = ActnCITY

I have linked my report based on the NumbOfAccts column.  I am able to get data if I click any of the NumbOfAccts values related to the state I want.  However when I am not sure how to make the subtotal and grand total work.  I want when I click on the subtotal of either coast, I should be able to see records of that coast e.g., if I select 37 I should be able to see all the records in East Coast.  If I click on the Grand Total, I only want data related to those 2 coasts.

View 2 Replies View Related

Reporting Services :: Way To Subscribe SSRS Report Using Dynamic Parameters For Email And Trigger Report

Feb 8, 2015

Is there a way to subscribe SSRS report using dynamic parameters for email and trigger the report from autosys job so that report should generate the exact time the job is triggered.Let me describe, my SSRS report should be triggered on success of one autosys job. i need to send email parameter and time of report schedule from this autosys job.

View 3 Replies View Related

While Exporting A SSRS 2005 Report In CSV Format ,can We Include The Report Headers And Footers Also To Be Exported

Nov 7, 2007



While exporting a SSRS 2005 report in CSV format ,can we include the report headers and footers also to be exported .
Thanks .

View 1 Replies View Related

SSRS (SQL Server Reporting Services) : Issue Navigating From Report To Report: Parameter Is Missing A Value

Sep 5, 2007

Hi,
I'm having problems navigating from one report to another one if the second report has a multi-valued report parameter. When I navigate to the second report, I don't pass any parameters, but I get an error "parameter is missing a value" for the multi-valued report parameter. I have it setup as allow "multi-value" and "blank value". Any idea what the issue might be?
Thanks.

View 3 Replies View Related

Reporting Services :: Display Logo / Image In Middle Of Report Header In SSRS Report

Jun 22, 2015

How to display the logo in middle of report header , The logo is embedded in the Image folder . The column of the report  are static. we are using SSRS 2008

View 6 Replies View Related

How To Display Data At Bottom Of Report By Daily, Weekly, Monthly, SYTD Using Ssrs Report

Dec 14, 2007

hai iam new to ssrs, please help me.


i have student billbale information assume what ever data it. i need to to dispaly total amount for the student at

Bottom Of Report By Daily, Weekly, Monthly, SYTD . take any example, i want to know formula.

thanks to advanced

Jacks v

View 1 Replies View Related

Reporting Services :: TFS Ssrs Report For WorkItemType Drill Down Report

Oct 2, 2015

I need to create a SSRS report using the Warehouse tfs_warehouse DB Report need to be drill down on WorkItemType Parents and child values. So, If we click on Product Back Log Item will get all the tasks inside it and so on....

------->Product BackLog items
                          ----------> Bugs Or Tasks
                                                -----------> Tasks

I have done research and found out how to do it in OLAP cube ..but still can't figure out the TSQL query to be used.Found one of the query on forum:

SELECT * FROM DimWorkItem DWI
INNER JOIN FactWorkItemLinkHistory FWILH ON DWI.System_Id = FWILH.TargetWorkItemID
WHERE FWILH.WorkItemLinkTypeSK IN (SELECT DWILT.WorkItemLinkTypeSK FROM DimWorkItemLinkType DWILT WHERE DWILT.LinkName = N'Child')
AND DWI.System_WorkItemType = N'Task'
AND DWI.System_Rev = (SELECT MAX(DWI1.System_Rev) FROM DimWorkItem DWI1 WHERE DWI1.System_Id = DWI.System_Id)
AND FWILH.SourceWorkItemID IN (SELECT DWI2.System_Id FROM DimWorkItem DWI2 WHERE DWI2.System_WorkItemType = N'Bug');

View 5 Replies View Related

Printing Remote Ssrs Report From Report View Does Not Work

Oct 9, 2007

Hi,

It appears to work fine on my end however on my clients end, whenever they try to print a report that displays perfectly within the report viewer to their printer by selecting the printer button in the report it never ends up printing.., however if they go into printer setup and change the page range to print from all pages to just maybe one page and then select the print button it seems to print fine..

The printer seems to receive the information as the light flashes but no page kick out when all pages is selected to print..

Any help would be greatly appreciated..

View 1 Replies View Related

SSRS : Visibility In A Sub-report Toggled By Master Report Item

Nov 29, 2007

Does anyone know if the visibility of anything (group, column etc) in a sub-report can be toggled by an item in the master report?
Thanks
Richard

View 4 Replies View Related

SSRS Report Rendering Different In VS2005 And In Report Viewer Via URL Access

Apr 17, 2008

Hello,
I'm using Reporting Services to render a text (stored in sql as varchar(max)). The text is all plain text, with some lines having trailing spaces.

Source text file i've imported to SQL via SSIS:
CLIENT: 10055
STATEMENT 2007
DATE:1002993
THIS IS THE OTHER STATEMENT
COLUMN1 COLUMN2 COLUMN 3
TRY THIS


*Note the trailing spaces on the line before 'STATEMENT 2007'.

I've designed a report using the Report Project in VS2005 to retrieve this text via a stored procedure. When I test the report using the 'Preview' tab in the IDE, it looks good
CLIENT: 10055
STATEMENT 2007
DATE:1002993
THIS IS THE OTHER STATEMENT
COLUMN1 COLUMN2 COLUMN 3
TRY THIS



But when I deploy the report and run it using URL Access:

CLIENT: 10055
STATEMENT 2007
DATE:1002993

THIS IS THE OTHER STATEMENT

COLUMN1 COLUMN2 COLUMN 3
TRY THIS

On all lines with trailing spaces, they (the trailing spaces) have been removed. This is affecting my formatting of some reports and statements. We really want to use the report viewer as it has built in paging, print and export capabilities.

Why does it look okay in VS2005 but different in Report Viewer via URL Access and Report Manager?

Note: When I export as PDF, it looks okay.

The stored procedure I use to return the data is a CLR Hosted assembly as below:



Code Snippet
Partial Public Class StoredProcedures
<Microsoft.SqlServer.Server.SqlProcedure()> _

Public Shared Sub GetPagedDocument(ByVal inText As SqlString)
Dim dr As SqlDataReader
Dim row As New SqlDataRecord(New SqlMetaData("RowText", SqlDbType.Text))
Dim cmd As New SqlCommand("select cast(doc as varchar(max)) as 'DOCTEXT' from testdoc WHERE id='" + inText + "'")
Dim cn As New SqlConnection("context connection=true")
cn.Open()
cmd.Connection = cn
SqlContext.Pipe.SendResultsStart(row) 'initialise the resultset to be returned
dr = cmd.ExecuteReader
'If no records in result set, return.
If Not dr.HasRows Then

row.SetString(0, "There is no document to display or you do not have permission to view the document.")
SqlContext.Pipe.SendResultsRow(row)
SqlContext.Pipe.SendResultsEnd()
' SqlContext.Pipe.Send("There is no document to display.")
Return
End If
'Read rows in the result set
dr.Read()

'Get the entire text
Dim docText As String = dr.Item("DOCTEXT")
'debug
row.SetString(0, docText)
SqlContext.Pipe.SendResultsRow(row)
SqlContext.Pipe.SendResultsEnd()
Return
'end debug

End Sub
End Class




Any help will be appreciated.

View 3 Replies View Related

Reporting Services :: Fixing Ssrs Report Table Column Heading While Scrolling Is Not Working In Report-viewer?

Dec 14, 2012

i just clicked on Advanced mode in Column Group, and then in Row Group Side i set Fixed Data=true for first  top static. I'm using local report not server report and i'm displaying that local report in Reportviewer. Now also its not working....

View 6 Replies View Related

Slow Report

Jan 18, 2007

As I sit here waiting for a test run of the report to complete, I'm forced to wonder why it's taking over 10 minutes... so far.

The query itself, when run through Management Studio takes about 50 seconds, so why would it take over 10 minutes to generate the report?  It's the only query being run, and it's not doing anything especially tricky with the data.  It's all actually being processed in the query, returning some counts and displaying them in a simple list.

Any thoughts?

EDIT:  I should mention that the query itself isn't very simple, so I can understand the query itself being slow... just not the report being 10 times slower than the query in management studio.

View 7 Replies View Related

T-SQL (SS2K8) :: Report Parameter Textbox In SSRS Report

Aug 12, 2014

I have a report parameter textbox in my SSRS report which has the parameter properties as "allow null value" and "allow blank value" checked.

How I can ensure that when the value is entered in textbox, it should accept any character ie. The SQL code I should write so that all the characters inputted via the report parameter are accepted.

View 1 Replies View Related

Running A SSRS Report In A Report Viewer Control In .net

Jun 29, 2007

Do I need the report server running in order view a SSRS report in a report viewer control? I've created my report in .net and it works great when I'm viewing it in visual studio, but can I run it my web app without the report server.

View 1 Replies View Related

Slow Report Generation

Dec 14, 2005

I have developed several reports with selectable parameters.  When the report is first requested three stored procedures are triggered and return the parameters (+2 min), following parameters being returned the default report is returned (+3 min), this time is unacceptable.  Is there anything I can do to speed up the report generation?  Any help here is greatly appreciated.

View 5 Replies View Related

Slow Initial Upload Of Report From .net

Jan 14, 2008

Hi,
In a .net application there is a link that brings up a SSRS report.
I have noticed that if it is the first time this report is requested i.e. Application has just been opened and the report button is clicked, then it takes a while to get this report to appear on the screen. But if this report is requested again (i.e. for the second time or more) then it only takes a few moments for the report to appear on the screen.
So it seems that only the first time the report is requested it takes a longer time to get this report. Is there a way to reduce this initial load of the report?
Thanks

View 3 Replies View Related

Slow Report From Simple Query

Apr 2, 2007

Hi all, I've been building a set of traffic based reports on our website and I've run into a strange problem.

The reports are pretty basic, and up till now I've been really impressed with RS overall.

Recently I've added a StartDate and EndDate and since then the performance has gone from ~10 secs to ~10 minutes.

I've taken a really simple query from my reports. Running this query in Management Studio on the same data returns in less than a second. When its run from a test report with nothing else in it it takes ~1 minute. Even stranger when I run the same query with the same values for parameters inside of RS in the data view it takes less than 1 second. ARG!


SELECT COUNT(DISTINCT SessionID) as Occurences
FROM WebAppSummary
JOIN WebAppLocalizations
ON WebAppSummary.ClientIp = WebAppLocalizations.ClientIp
where FirstTime BETWEEN @StartDate AND @EndDate


The last line that was just added is this part:
where FirstTime BETWEEN @StartDate AND @EndDate

So whats going on here? Is this a really poorly performing query that management studio is optimizing but RS isnt? Is RS messing up the databind and getting a bunch of DSs instead of just one?

View 1 Replies View Related

Initial Report Load Is Slow

Apr 14, 2008

Each day, the first user who launches our RS reports always gets a long wait time. Subsequent report launches are normal.
Does anyone know what is going on? If yes, what is the remedy?

Thanks

View 1 Replies View Related

SSRS Action Report Through Proclarity Report

May 8, 2008

Hello Friends,
I am using an action report(SSRS Report) in a Proclarity report in which the user generate action report on some particular filters. The problem is : In this report (SSRS report) I am using two row groups and three data fields and intially i am displaying the report in collapsed manner. The report is working fine in BIDS and as well as on the report server. But when i am generating the report through prolarity , the report is getting generate but when i tried to expand the collapsed field its throwing an error
"An internal error occured on the report server. See the error log for more details. Specified argument was out of the range of valid values"

Can anyone help me out to solve this issue.

Thanks & Regard's

View 1 Replies View Related

Is Such A Report Possible Using SSRS 2005 Report Builder?

Jun 4, 2007

I have RS 2005 SP1. I have a report model developed and deployed.



I have a scenario and I am not sure if it is possible to create a report for this scenario using the report builder. Let's say I have a customers entity and address entity that is related to the customer's entity as a 1-many relationship. I have the effective date on the address that specifies the date from which the address is effective. A customer will have multiple records in address with the latest effective date as the latest address of the customer.



Suppose, I need to create a report using the report builder to get the list of latest address for customers, how can I do it? I know it can be done using the report designer using a query that uses the group by clause. But can it be done using report builder?



Thanks in advance.

View 4 Replies View Related

Problem With Writting A Report (SQL Slow Running)

Jul 20, 2005

HiI am trying to write a report that calculates the average number of salesover 7, 14, 31 and 365 days for each hourly period of the day. the problemis it takes over 4 minutes to run.e.g.Average Xactions per Hour7 Days 14 Days 31 Days 365 Days00:00 - 01:00 1,141.6 579.2 261.6 28.801:00 - 02:00 1,298.0 649.6 293.4 30.0The report was use to be purely ASP running SQL Statements.I then changed it to ASP Running a SP 24 times - this reduced running timeby about 1 minute.I then changed it so that the stored proc looped internally 24 times andreturns the data.I have ran the Index Tuning Wizard on the SQL and Implemented the indexessuggested - this actually increase execution time by 20 seconds.Below is the stored procedure I am currently using that loops internally 24times and returns the data.Can anyone suggest a better way / any improvements I could make ?Many ThanksSteve-----------------------------------------------------------------------------------------------------CREATE procedure ams_RPT_Gen_Stats@strResult varchar(8) = 'Failure' output,@strErrorDesc varchar(512) = 'SP Not Executed' output,@strTest varchar(1),@strCurrency varchar(3),@strVFEID varchar(16)asdeclare @strStep varchar(32)set @strStep = 'Start of Stored Proc'/* start insert sp code here */create table ##Averages (TheHour varchar(2),Day7Avge float ,Day14Avge float ,Day31Avge float ,Day365Avge float)declare @numHour varchar(2)declare @strSQL varchar(2000)declare @Wholesalers varchar(64)declare MyHours cursor FORWARD_ONLY READ_ONLY forselect convert(char(2), timestamp,14) as TheHourfrom xactionsgroup by convert(char(2), timestamp,14)order by convert(char(2), timestamp,14)if @strTest = 'Y'select @Wholesalers = VALUE FROM BUSINESSRULES WHERE NAME ='TEST_Wholesalers'open MyHoursfetch next from MyHours into @numHourwhile @@fetch_status = 0beginset @strSQL = 'insert into ##Averages (TheHour, Day7Avge) ( select ''' +@numHour + ''', ' +'count(*) / 7.00 ' +'FROM ' +'XACTIONS INNER JOIN ' +'RETAILER ON XACTIONS.RETAILERID = RETAILER.RETAILERID ' +'WHERE ' +'(DATEDIFF(DAY , xactions.timestamp , GETDATE() ) < 8) and ' +'xactions.xactiontotal <> 0 and ' +' convert(char(2) , timestamp, 14) = ''' + @numHour + ''' 'if @strTest = 'Y'set @strSQL = @strSQL + ' and retailer.BillOrgID not in (' +@Wholesalers + ') 'if @strCurrency <> '*'set @strSQL = @strSQL + ' and xactions.XACTIONCURRENCY = ''' +@strCurrency + ''' 'if @strVFEID <> '*'set @strSQL = @strSQL + ' and xactions.VFEID = ''' + @strVFEID + ''''set @strSQL = @strSQL + ')'exec ( @strSQL )set @strSQL = 'update ##Averages set Day14Avge = ( select ' +'count(*) / 14.00 ' +'FROM ' +'XACTIONS INNER JOIN ' +'RETAILER ON XACTIONS.RETAILERID = RETAILER.RETAILERID ' +'WHERE ' +'(DATEDIFF(DAY , xactions.timestamp , GETDATE() ) < 15) and ' +'xactions.xactiontotal <> 0 and ' +' convert(char(2) , timestamp, 14) = ''' + @numHour + ''' 'if @strTest = 'Y'set @strSQL = @strSQL + ' and retailer.BillOrgID not in (' +@Wholesalers + ') 'if @strCurrency <> '*'set @strSQL = @strSQL + ' and xactions.XACTIONCURRENCY = ''' +@strCurrency + ''' 'if @strVFEID <> '*'set @strSQL = @strSQL + ' and xactions.VFEID = ''' + @strVFEID + ''' 'set @strSQL = @strSQL + ') where TheHour = ''' + @numHour + ''' 'exec ( @strSQL )set @strSQL = 'update ##Averages set Day31Avge = ( select ' +'count(*) / 31.00 ' +'FROM ' +'XACTIONS INNER JOIN ' +'RETAILER ON XACTIONS.RETAILERID = RETAILER.RETAILERID ' +'WHERE ' +'(DATEDIFF(DAY , xactions.timestamp , GETDATE() ) < 32) and ' +'xactions.xactiontotal <> 0 and ' +' convert(char(2) , timestamp, 14) = ''' + @numHour + ''' 'if @strTest = 'Y'set @strSQL = @strSQL + ' and retailer.BillOrgID not in (' +@Wholesalers + ') 'if @strCurrency <> '*'set @strSQL = @strSQL + ' and xactions.XACTIONCURRENCY = ''' +@strCurrency + ''' 'if @strVFEID <> '*'set @strSQL = @strSQL + ' and xactions.VFEID = ''' + @strVFEID + ''' 'set @strSQL = @strSQL + ' ) where TheHour = ''' + @numHour + ''' 'exec ( @strSQL )set @strSQL = 'update ##Averages set Day365Avge = ( select ' +'count(*) / 365.00 ' +'FROM ' +'XACTIONS INNER JOIN ' +'RETAILER ON XACTIONS.RETAILERID = RETAILER.RETAILERID ' +'WHERE ' +'(DATEDIFF(DAY , xactions.timestamp , GETDATE() ) < 366) and ' +'xactions.xactiontotal <> 0 and ' +' convert(char(2) , timestamp, 14) = ''' + @numHour + ''' 'if @strTest = 'Y'set @strSQL = @strSQL + ' and retailer.BillOrgID not in (' +@Wholesalers + ') 'if @strCurrency <> '*'set @strSQL = @strSQL + ' and xactions.XACTIONCURRENCY = ''' +@strCurrency + ''' 'if @strVFEID <> '*'set @strSQL = @strSQL + ' and xactions.VFEID = ''' + @strVFEID + ''' 'set @strSQL = @strSQL + ' ) where TheHour = ''' + @numHour + ''' 'exec ( @strSQL )fetch next from MyHours into @numHourend -- while fetchclose MyHoursdeallocate MyHoursselect * from ##Averages order by TheHourdrop table ##Averages/* end insert sp code here */if (@@error <> 0)beginset @strResult = 'Failure'set @strErrorDesc = 'Fail @ Step :' + @strStep + ' Error : ' +CONVERT(VARCHAR,@@Error)return -1969endelsebeginset @strResult = 'Success'set @strErrorDesc = ''endreturn 0GO

View 1 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved