Showing posts with label services. Show all posts
Showing posts with label services. Show all posts

Sunday, March 25, 2012

Case sensitive query? Problems with Integration Services Query

Hi,
i am writing a IntegrationServices2005 job which copies the result of a
view to a table.
I found a very strange problem:
select * from [dbo].[warehouse_aufwandurlaub] -> runs in < 1 second.
select * from [dbo].[warehouse_AufwandUrlaub] -> runs in > 30 Second
s
(timeout).
the name of the view is "warehouse_AufwandUrlaub".
If i run the query in query analyzer, both querys exectute very fast.
What is causing this failure? how can i avoid this?
Thx
Best regards,
Patrick DingerSorry i forgot to mention, that i am using SQL Server 2005 with SP1.
Thx in advance,
Patrick Dinger|||Any activites on the server at this time?
Don't you really need WHERE condition?
"Patrick Dinger" <paxos2k@.gmail.com> wrote in message
news:1147690976.451955.271160@.j55g2000cwa.googlegroups.com...
> Sorry i forgot to mention, that i am using SQL Server 2005 with SP1.
> Thx in advance,
> Patrick Dinger
>|||Hi,
its not an ressource problem, there isn't really activity on the server
currently.
the error is reproducible. No, i do not need a where condition...
Best regards,
Patrick Dinger

Case sensitive query? Problems with Integration Services Query

Hi,
i am writing a IntegrationServices2005 job which copies the result of a
view to a table.
I found a very strange problem:
select * from [dbo].[warehouse_aufwandurlaub] -> runs in < 1 second.
select * from [dbo].[warehouse_AufwandUrlaub] -> runs in > 30 Seconds
(timeout).
the name of the view is "warehouse_AufwandUrlaub".
If i run the query in query analyzer, both querys exectute very fast.
What is causing this failure? how can i avoid this?
Thx
Best regards,
Patrick DingerSorry i forgot to mention, that i am using SQL Server 2005 with SP1.
Thx in advance,
Patrick Dinger|||Any activites on the server at this time?
Don't you really need WHERE condition?
"Patrick Dinger" <paxos2k@.gmail.com> wrote in message
news:1147690976.451955.271160@.j55g2000cwa.googlegroups.com...
> Sorry i forgot to mention, that i am using SQL Server 2005 with SP1.
> Thx in advance,
> Patrick Dinger
>|||Hi,
its not an ressource problem, there isn't really activity on the server
currently.
the error is reproducible. No, i do not need a where condition...
Best regards,
Patrick Dinger

Monday, March 19, 2012

Cascading Parameters error

I am new to SQL Reporting services - (3 weeks in fact)
I have a report that uses cascading parameters down 2 levels
I select from a dropdown which populates the second dropdown.
I then select from the second drop down list.
There are three more parameters to be entered in by the user - (these
are not drop down lists)
type of test
start date
end date
This runs fine in the test environment
I deploy
then select from my first dropdown.
It crashes out because start date and end date are not entered
It appears that the page is refreshing with all the parameters even
though they are not entered.
Any help is greatly appreciated.
ThanksTry changing the order of your parameters. Put the start and end date
at the beginning.
Or put in defaults. Start and end date of yesterday and today for
example.|||How are you implementing cascading parameters. I have been needing to do
something like this, but do not see how it would be done.
Thanks
John
"Ches Weldishofer" wrote:
> Try changing the order of your parameters. Put the start and end date
> at the beginning.
> Or put in defaults. Start and end date of yesterday and today for
> example.
>|||I am not experienced enough to explain it to you correctly - RS books
online explains it quite well|||Changing the order etc as you say works fine
Thank you very much
Can you recommend a good book for a beginner?

Cascading Parameters based off Analysis Services

Hello,

I was trying to do cascading parameters based off my cube and I wasn't able to do this. Is it possible?

For example, I have a dimension that has Products so I first select the parameter for product type (Dairy, Frozen, Candy) and then I have another dropdown listbox that has the name of each product (Milk, Ice Cream, Lemon Drops). The second dropdown listbox should only contain the products that match what parameter was selected in the first dropdown.

When I couldn't get that to work, I went to the source system containing the Dimension tables and just did nice and easy SQL statements from there. It worked but I, for some reason that I can't explain, think this is not the proper way to do it.

Also, is there a way to have a default on the second parameter based on the first parameter selected? I would assume that default would be [All].

Thank you.

-Gumbatman

Yes it is possible. When you use the query designer, by default each parameter depends on the one before it having a value, even if the parameters are not really related. For this, you want to maintain that link. Then, in your MDX that creates the dataset for parameter #2 you can refer to parameter #1 (it will be called something like @.MyParameterName), i.e. you can use it as part of a STRTOSET or STRTOMEMBER function.|||

Sluggy,

Thank you so much for this answer. I was banging my head against the wall trying to figure out how to do this.

-Gumbatman

|||

Could you please post an example of this? My head also aches a lot

I just need the MDX syntax of the second dataset, the one of the parameter that depends on the first one selected.

Is there any way, from within SSRS to "filter" based on the previous parameter inside the MDX sentence?

Using SQL tables datasources and cascading parameters is quite straightforward, not the same with Olap cubes as datasources.

Thank you

Mike

Sunday, March 11, 2012

Cascading Parameters

Hi,

I am using SQL Server 2005 reporting services. I am having a problem with Cascading Parameters. In my report there are 4 parameter . (Product Class, Product Type, Product SubType and Activites). when user open the report page he/she will have to select a value for product class depending on the selection Product Type and Sub type will be populated. So far its good, but Activities also depends on the Product Class. My question is can we have 2 parameters depend on same parameter. Here in this case Product Type and Activities both depend on the Product Class. I want only those activies in the dropdown which belongs to the Product Class that is selected.

Can anyone please give an ideas?

Thanks

Ashwini

Hi Ashwini,

I am assuming that you are using datasets or stored procedures to fill the parameters. If that is the case, This link -MIGHT- get you in the right direction.

http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=67984&SiteID=1

It is concerning about which dataset is being executed first, and with this, you might be able to execute certain datasets to get what you need and then based the next dataset on the previously executed dataset.

Hope this helps!

Bernard

|||

Hi Bernard,

Yes I have created 4 datasets with stored procedures to fill these report parameters.

SP1 : SelectProductClassAll -->which brings in all the product class

SP2: RptSelectCascadedProductType --> which has a parameter @.selected_product_class and will bring in all the product types for the given product class.

SP3: RptSelectCascadedProductSubType --> which has a parameter @.selected_product_type and will bring in all the product sub-types for the given product types.

SP4: RptSelectCascadedProductSubType --> which has a parameter @.selected_product_class and will bring in all the Activities for the given product class.

Problem is 2nd and 4th SP expects the same parameter. After adding these datasets if you go to Report -->Report Parameters you will only have 2 parameters (which would act as a drop down filter) @.selected_product_class , @.selected_product_type and I added one for Subtypes these 3 drop downs are fine. But I am not able to get the dropdown for activites since my SP4 expects the same parameter as SP1 and I cant use the same name parameter name twice?

I hope I am clear...

I looked at the link which you send it did not give me enough information so I am still confused...

Thanks

Ashwini

|||

HI Ashwini.

Actually you should be able to use the same parameter name.

Have you tried using only 3 parameters instead of 4 parameters ?

I mean, logically speaking, since two SPs are using ONE parameter, I don't see a reason why you would try and use another Report Parameter. Just make sure that the 2 stored procedures are pointing to one Parameter.

The link I posted tells of how datasets can be executed in order depending on what you need. In this case, you would want to execute SP1, before executing Sp2 and Sp3 right ?

Of course unless, I am getting it all confused myself which is not a good thing.

Bernard

|||

Without reading in detail too much, I'd say yes to you can re-use same parameter (same name) for different parameters

e.g. our reports have performance venue dropdown based on the date range selected (@.start_date to @.end_date)

then performance type, based on the venue AND date range

then say seating zones of the venue, based on type AND venue AND date range

|||

Ok may be I am understanding the concept of report parameter wrong...If I only have 3 parameters it will only show 3 dropdown menu when I actually run the report right? for ex: Product class, type and subtype. I need to have another dropdown menu for Activities as well how would I get this if I dont have a report parameter for it?

As per my understanding SRS will create these dropdown menus for you based on the report parameter. Please correct me if I am wrong...

|||In your case, you only have 3 params, isn't it. The #2 and #4 sp share the same parameter which is your Selected_Product_Class. So when user makes a selection for ProductClass both sp should run based on that Product Class. If you want to pass different values of Selected_Product_Class to these 2 sp, then you need to define 2 separate parameters and fill them both with your #1 sp. But in that case you will have 2 Selected_Product_Class, not sure if that's what you intend to do.|||

Ashwini Ramaiah wrote:

I need to have another dropdown menu for Activities as well how would I get this if I dont have a report parameter for it?

Define another parameter and fill it with your #1 sp, just liek you did earlier. And pass the value of this param to your #4 sp. But this way, user will be able to select 2 different values of your ProductClass. If you want them to be same, then just fill this new param with the value of your already selected product class parameter.

|||

Thanks Everyone!!!

Its working now....I am not sure what was the problem. All I did was delete all my parameter and datasets and re do it. I created a 4th parameter and hooked it up with Activities Data which in turn is looking fo SP4 which expects @.selected_Product_Class parameter. Trust me I did try this like 100 times it didnt work that time when I deleted the whole thing and recreated all the parameters its all good now.

I have 4 dropdowns in my Report when user comes in He/She would only be able to select a value from Product Class rest 3 will be grayed once product class is selected Product type and Activities dropdown's data gets populated and the user can select Product Sub type which is 4th dropdown. This is exactly what I wanted.

Once again thanks to everyone!!!

Ashwini

Saturday, February 25, 2012

Capturing Processing Status and Progress Messages

When you use BI Dev Studio or SS Management Studio to process an Analysis Services database or object, there's a nice dialog box that shows very robust status and progress information.

Is there any way to capture this information if you are processing something programmatically? Specifically interested in both the ability to capture and display this information to a user when processing via a custom application. Also interested in whether or not there's a way to capture this information to a log (or table) for display and analysis after the fact (or if the custom application is running in a batch mode via a schedule).

Thanks,
Dave Fackler
I've been looking for the same thing. Were you able to find where this information is stored/logged?

Thanks!
|||One simple way to do this is using the SQL Server Profiler tool which has the option of logging trace information to files or tables as well as the UI. You can also do this programmatically using the AMO using Server.SessionTrace or by adding custom traces to Server.Traces.|||

Using the AMO, you can listen Session Trace. Sample code is following:

this.sessionTrace = server.SessionTrace;

this.sessionTrace.OnEvent += new TraceEventHandler(sessionTrace_TraceEventHandler);

this.sessionTrace.Stopped += new TraceStoppedEventHandler(sessionTrace_Stopped);

if (!this.sessionTrace.IsStarted)

{

this.sessionTrace.Start();

}

|||

You can use AMO (Microsoft.AnalysisServices.dll from "%ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies") to subscribe to trace events. Sample code below. The code formatting might be lost when posting, but copy paste in VS, and then "Edit -> Advanced -> Format Document" should fix it.

//=====================================================================
//
// File: Program.cs
// Summary: Sample code for using traces with AMO.
// Date: 2006-05-23
//
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
//=====================================================================
using System;
using Microsoft.AnalysisServices;

namespace Microsoft.AnalysisServices.CodeSamples
{
/// <summary>
/// Demonstrates use of traces with AMO.
/// </summary>
/// <remarks>
/// This code requires the "Adventure Works" database to be present on the Analysis Services server
/// and also the "AdventureWorksDW" relational database on SQL Server (for processing objects to
/// generate trace events).
/// </remarks>
class AmoTrace
{
static int Main(string[] args)
{
//--
// There are 2 types of traces that AMO programmer can use:
// - the session trace: provides the events from the current session (established
// on Connect)
// - the custom traces: they allow to choose the particular event classes and
// columns to be traced. Unlike the session trace, a custom trace needs to be
// created and saved to server explicitly (as any other AMO object, like a
// Dimension or a Cube).
//
// This is the plan of the code:
// 1. we'll connect to an Analysis Services server
// 2. we'll locate the "Product" dimension from the "Adventure Works DW" database
// (we'll process it to generate trace events)
// 3. we'll use the session trace
// 4. we'll create, use and then delete a custom trace
//--

string connectionString = "Data Source=localhost";
string databaseName = "Adventure Works DW"; // use "Adventure Works DW Standard Edition" if you have the standard edition installed

try
{
//--
// STEP 1: connect to Analysis Services server.
//--
Server server = new Server();
server.Connect(connectionString);

try
{
//--
// STEP 2: locate the "Product" dimension.
//--
Database database = server.Databases.FindByName(databaseName);
if (database == null)
{
Console.Error.WriteLine("The [{0}] database is missing.", databaseName);
return 1;
}

Dimension productDimension = database.Dimensions.FindByName("Product");
if (productDimension == null)
{
Console.Error.WriteLine("The [Product] dimension is missing.");
return 1;
}

//--
// STEP 3: use the session trace.
//--
UseSessionTrace(server, productDimension);

//--
// STEP 4. create, use and then delete a custom trace.
//--
UseCustomTrace(server, productDimension);

return 0;
}
finally
{
server.Disconnect();
}
}
catch (Exception e)
{
Console.Error.WriteLine(e.ToString());
return 1;
}
}

/// <summary>
/// Demonstrates the use of session trace.
/// </summary>
private static void UseSessionTrace(Server server, Dimension dimensionToProcess)
{
//--
// 1. Subscribe to the session trace events.
//--
SessionTrace sessionTrace = server.SessionTrace;
TraceEventHandler onTraceEvent = new TraceEventHandler(OnTraceEvent);
TraceStoppedEventHandler onTraceStopped = new TraceStoppedEventHandler(OnTraceStopped);

sessionTrace.OnEvent += new TraceEventHandler(OnTraceEvent);
sessionTrace.Stopped += new TraceStoppedEventHandler(OnTraceStopped);
sessionTrace.Start(); // this method is not blocking, it starts a separate thread to listen for events from server

//--
// 2. Process the dimension; this will generate events that we'll display to
// the Console.
//--
try
{
dimensionToProcess.Process(ProcessType.ProcessFull); // this method blocks; while processing, events are received
}
finally
{
//--
// 3. Un-subscribe from the trace.
//--
sessionTrace.Stop();
sessionTrace.OnEvent -= onTraceEvent;
sessionTrace.Stopped -= onTraceStopped;
}
}

/// <summary>
/// Demonstrates the use of a custom trace.
/// </summary>
private static void UseCustomTrace(Server server, Dimension dimensionToProcess)
{
//--
// 1. Create and save to server a custom trace with only the
// ProgressReportBegin, ProgressReportCurrent and ProgressReportEnd events
// and the EventClass and EventSubclass columns.
//--
Trace trace = server.Traces.Add(); // a Name and ID will be generated for the new Trace
TraceEvent event1 = trace.Events.Add(TraceEventClass.ProgressReportBegin);
TraceEvent event2 = trace.Events.Add(TraceEventClass.ProgressReportCurrent);
TraceEvent event3 = trace.Events.Add(TraceEventClass.ProgressReportEnd);

event1.Columns.Add(TraceColumn.EventClass);
event1.Columns.Add(TraceColumn.EventSubclass);

event2.Columns.Add(TraceColumn.EventClass);
event2.Columns.Add(TraceColumn.EventSubclass);

event3.Columns.Add(TraceColumn.EventClass);
event3.Columns.Add(TraceColumn.EventSubclass);

// Save the newly created Trace to the server; others could use it (unlike the session
// trace which is specific to a particular session).
trace.Update();


//--
// 2. Subscribe to the newly create trace.
//--
TraceEventHandler onTraceEvent = new TraceEventHandler(OnTraceEvent);
TraceStoppedEventHandler onTraceStopped = new TraceStoppedEventHandler(OnTraceStopped);

trace.OnEvent += new TraceEventHandler(OnTraceEvent);
trace.Stopped += new TraceStoppedEventHandler(OnTraceStopped);
trace.Start(); // this method is not blocking, it starts a separate thread to listen for events from server

//--
// 3. Process the dimension; this will generate events that we'll display to
// the Console.
//--
try
{
dimensionToProcess.Process(ProcessType.ProcessFull); // this method blocks; while processing, events are received
}
finally
{
//--
// 3. Un-subscribe from the trace.
//--
trace.Stop();
trace.OnEvent -= onTraceEvent;
trace.Stopped -= onTraceStopped;
}


//--
// 4. Cleanup: delete the trace from the server. We could leave it (to be used
// in the future or by other users), but we'll delete it since it was only a
// sample.
//--
trace.Drop();
}

/// <summary>
/// Event handler for trace events, called on a separate thread by the AMO trace.
/// </summary>
/// <remarks>
/// When the Start() method is called on a Trace, AMO creates a separate thread
/// that listens for events from the server; when an event is read, this method is
/// called on that thread. There should be no heavy calculations in this method
/// because the trace thread will be blocked and events might overflow the connection's
/// buffer(s), resulting in loss of events.
/// </remarks>
private static void OnTraceEvent(object sender, TraceEventArgs e)
{
Console.WriteLine("Event ({0}, {1})", e.EventClass, e.EventSubclass);
}

/// <summary>
/// Event handler for trace stop events, called on a separate thread by the AMO trace when
/// a trace is stopped (by the user, by the server or by an exception).
/// </summary>
/// <remarks>
/// There are 3 main reasons for a trace to be stopped:
/// - the user called the Stop() method
/// - the server ended the trace (because somebody deleted it meanwhile for example)
/// - an exception occured during parsing of events (because of a network disconnect for example)
/// </remarks>
private static void OnTraceStopped( ITrace sender, TraceStoppedEventArgs e )
{
Console.WriteLine("Trace Stopped: Cause = {0}, Exception = {1}", e.StopCause, e.Exception);
}
}
}

Adrian Dumitrascu.

|||Does anyone know if there is anyway of figuring out which events support which columns from the object model? At the moment I have had to resort to hard coding the columns supported by a given event.|||Thanks for all the responses and the sample code!

I would like to capture this information using SSIS. Of course, the script tasks only supports VB as well. Is there an easy way to capture trace information from the cube processing within SSIS?

Thanks again for all the help!
|||

AMO doesn't provide the list of supported columns for a particular trace event. But, there are 2 other places containing the associations:

- the "tracedefinition90.xml" file (search for it in "%ProgramFiles%\Microsoft SQL Server"). You will need to parse it to generate a user-friendlier map. But please note that this file might change in the future (probably not the xml schema, but columns/events might be added/removed/changed).

- SQL Profiler; when you create a new AS2005 trace, in the 'Trace Properties' window, see the 'Events Selection' tab (generated from the trace definition file)

Adrian Dumitrascu

|||

I don't have yet a sample VB.NET code for using AMO traces, but a work-around is to have a separate assembly containing the trace code (written in C# from the sample posted previously) and use this assembly from the VB.NET script task in SSIS.

Adrian Dumitrascu

|||

You could try running the sample code through one of the online C# to VB.NET converters (eg. http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx). They are not perfect, but they can get you pretty close.

I don't know if the event handling code will work inside an SSIS script task. In this case one option might be to configure the trace to log to a file.

|||

Thanks Adrian, the tracedefinitions90.xml looks like it could be very useful.

The other thing I just found was that by going File -> Export -> Script Trace Definition. I can get an xmla script that will create the server side trace.

This might suit my needs as I can configure the trace using the profiler GUI, script it out and then just get my app to execute the xmla and then connect to the server side trace.

|||

Hi,

I have created an analysis services project using SQL Server 2005, in which I have included a cube, dimension, data source and data view. Now using the Analysis services Browser tab of cube I can see the Pivot table exactly the way I want where I can drag & drop table fields as per my requirements. But I am struggling to display the same cube over the Web. Can any please tell me that how I can publish the contents of Cube i.e. Pivot table on a web application so that end user can use this. I want the same functionality, which I can see in the Browser tab of Cube in AS2005 i.e. user should have freedom to drag & drop the fields exactly like in Excel Pivot table.

Any help would be highly appreciated.

Thanks in advance.

|||

Take a look at the following link on Mosha's website. It contains a set of links to web-based browsers and applications. You can probably use them as a guide to developing your own custom web-based app for doing this (or perhaps use one of the listed applications directly).

http://www.mosha.com/msolap/util.htm#ThinClients

HTH,

Dave Fackler

Capturing Processing Status and Progress Messages

When you use BI Dev Studio or SS Management Studio to process an Analysis Services database or object, there's a nice dialog box that shows very robust status and progress information.

Is there any way to capture this information if you are processing something programmatically? Specifically interested in both the ability to capture and display this information to a user when processing via a custom application. Also interested in whether or not there's a way to capture this information to a log (or table) for display and analysis after the fact (or if the custom application is running in a batch mode via a schedule).

Thanks,
Dave Fackler
I've been looking for the same thing. Were you able to find where this information is stored/logged?

Thanks!
|||One simple way to do this is using the SQL Server Profiler tool which has the option of logging trace information to files or tables as well as the UI. You can also do this programmatically using the AMO using Server.SessionTrace or by adding custom traces to Server.Traces.|||

Using the AMO, you can listen Session Trace. Sample code is following:

this.sessionTrace = server.SessionTrace;

this.sessionTrace.OnEvent += new TraceEventHandler(sessionTrace_TraceEventHandler);

this.sessionTrace.Stopped += new TraceStoppedEventHandler(sessionTrace_Stopped);

if (!this.sessionTrace.IsStarted)

{

this.sessionTrace.Start();

}

|||

You can use AMO (Microsoft.AnalysisServices.dll from "%ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies") to subscribe to trace events. Sample code below. The code formatting might be lost when posting, but copy paste in VS, and then "Edit -> Advanced -> Format Document" should fix it.

//=====================================================================
//
// File: Program.cs
// Summary: Sample code for using traces with AMO.
// Date: 2006-05-23
//
//
//
// Copyright (C) Microsoft Corporation. All rights reserved.
//
// THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO
// THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
// PARTICULAR PURPOSE.
//
//=====================================================================
using System;
using Microsoft.AnalysisServices;

namespace Microsoft.AnalysisServices.CodeSamples
{
/// <summary>
/// Demonstrates use of traces with AMO.
/// </summary>
/// <remarks>
/// This code requires the "Adventure Works" database to be present on the Analysis Services server
/// and also the "AdventureWorksDW" relational database on SQL Server (for processing objects to
/// generate trace events).
/// </remarks>
class AmoTrace
{
static int Main(string[] args)
{
//--
// There are 2 types of traces that AMO programmer can use:
// - the session trace: provides the events from the current session (established
// on Connect)
// - the custom traces: they allow to choose the particular event classes and
// columns to be traced. Unlike the session trace, a custom trace needs to be
// created and saved to server explicitly (as any other AMO object, like a
// Dimension or a Cube).
//
// This is the plan of the code:
// 1. we'll connect to an Analysis Services server
// 2. we'll locate the "Product" dimension from the "Adventure Works DW" database
// (we'll process it to generate trace events)
// 3. we'll use the session trace
// 4. we'll create, use and then delete a custom trace
//--

string connectionString = "Data Source=localhost";
string databaseName = "Adventure Works DW"; // use "Adventure Works DW Standard Edition" if you have the standard edition installed

try
{
//--
// STEP 1: connect to Analysis Services server.
//--
Server server = new Server();
server.Connect(connectionString);

try
{
//--
// STEP 2: locate the "Product" dimension.
//--
Database database = server.Databases.FindByName(databaseName);
if (database == null)
{
Console.Error.WriteLine("The [{0}] database is missing.", databaseName);
return 1;
}

Dimension productDimension = database.Dimensions.FindByName("Product");
if (productDimension == null)
{
Console.Error.WriteLine("The [Product] dimension is missing.");
return 1;
}

//--
// STEP 3: use the session trace.
//--
UseSessionTrace(server, productDimension);

//--
// STEP 4. create, use and then delete a custom trace.
//--
UseCustomTrace(server, productDimension);

return 0;
}
finally
{
server.Disconnect();
}
}
catch (Exception e)
{
Console.Error.WriteLine(e.ToString());
return 1;
}
}

/// <summary>
/// Demonstrates the use of session trace.
/// </summary>
private static void UseSessionTrace(Server server, Dimension dimensionToProcess)
{
//--
// 1. Subscribe to the session trace events.
//--
SessionTrace sessionTrace = server.SessionTrace;
TraceEventHandler onTraceEvent = new TraceEventHandler(OnTraceEvent);
TraceStoppedEventHandler onTraceStopped = new TraceStoppedEventHandler(OnTraceStopped);

sessionTrace.OnEvent += new TraceEventHandler(OnTraceEvent);
sessionTrace.Stopped += new TraceStoppedEventHandler(OnTraceStopped);
sessionTrace.Start(); // this method is not blocking, it starts a separate thread to listen for events from server

//--
// 2. Process the dimension; this will generate events that we'll display to
// the Console.
//--
try
{
dimensionToProcess.Process(ProcessType.ProcessFull); // this method blocks; while processing, events are received
}
finally
{
//--
// 3. Un-subscribe from the trace.
//--
sessionTrace.Stop();
sessionTrace.OnEvent -= onTraceEvent;
sessionTrace.Stopped -= onTraceStopped;
}
}

/// <summary>
/// Demonstrates the use of a custom trace.
/// </summary>
private static void UseCustomTrace(Server server, Dimension dimensionToProcess)
{
//--
// 1. Create and save to server a custom trace with only the
// ProgressReportBegin, ProgressReportCurrent and ProgressReportEnd events
// and the EventClass and EventSubclass columns.
//--
Trace trace = server.Traces.Add(); // a Name and ID will be generated for the new Trace
TraceEvent event1 = trace.Events.Add(TraceEventClass.ProgressReportBegin);
TraceEvent event2 = trace.Events.Add(TraceEventClass.ProgressReportCurrent);
TraceEvent event3 = trace.Events.Add(TraceEventClass.ProgressReportEnd);

event1.Columns.Add(TraceColumn.EventClass);
event1.Columns.Add(TraceColumn.EventSubclass);

event2.Columns.Add(TraceColumn.EventClass);
event2.Columns.Add(TraceColumn.EventSubclass);

event3.Columns.Add(TraceColumn.EventClass);
event3.Columns.Add(TraceColumn.EventSubclass);

// Save the newly created Trace to the server; others could use it (unlike the session
// trace which is specific to a particular session).
trace.Update();


//--
// 2. Subscribe to the newly create trace.
//--
TraceEventHandler onTraceEvent = new TraceEventHandler(OnTraceEvent);
TraceStoppedEventHandler onTraceStopped = new TraceStoppedEventHandler(OnTraceStopped);

trace.OnEvent += new TraceEventHandler(OnTraceEvent);
trace.Stopped += new TraceStoppedEventHandler(OnTraceStopped);
trace.Start(); // this method is not blocking, it starts a separate thread to listen for events from server

//--
// 3. Process the dimension; this will generate events that we'll display to
// the Console.
//--
try
{
dimensionToProcess.Process(ProcessType.ProcessFull); // this method blocks; while processing, events are received
}
finally
{
//--
// 3. Un-subscribe from the trace.
//--
trace.Stop();
trace.OnEvent -= onTraceEvent;
trace.Stopped -= onTraceStopped;
}


//--
// 4. Cleanup: delete the trace from the server. We could leave it (to be used
// in the future or by other users), but we'll delete it since it was only a
// sample.
//--
trace.Drop();
}

/// <summary>
/// Event handler for trace events, called on a separate thread by the AMO trace.
/// </summary>
/// <remarks>
/// When the Start() method is called on a Trace, AMO creates a separate thread
/// that listens for events from the server; when an event is read, this method is
/// called on that thread. There should be no heavy calculations in this method
/// because the trace thread will be blocked and events might overflow the connection's
/// buffer(s), resulting in loss of events.
/// </remarks>
private static void OnTraceEvent(object sender, TraceEventArgs e)
{
Console.WriteLine("Event ({0}, {1})", e.EventClass, e.EventSubclass);
}

/// <summary>
/// Event handler for trace stop events, called on a separate thread by the AMO trace when
/// a trace is stopped (by the user, by the server or by an exception).
/// </summary>
/// <remarks>
/// There are 3 main reasons for a trace to be stopped:
/// - the user called the Stop() method
/// - the server ended the trace (because somebody deleted it meanwhile for example)
/// - an exception occured during parsing of events (because of a network disconnect for example)
/// </remarks>
private static void OnTraceStopped( ITrace sender, TraceStoppedEventArgs e )
{
Console.WriteLine("Trace Stopped: Cause = {0}, Exception = {1}", e.StopCause, e.Exception);
}
}
}

Adrian Dumitrascu.

|||Does anyone know if there is anyway of figuring out which events support which columns from the object model? At the moment I have had to resort to hard coding the columns supported by a given event.|||Thanks for all the responses and the sample code!

I would like to capture this information using SSIS. Of course, the script tasks only supports VB as well. Is there an easy way to capture trace information from the cube processing within SSIS?

Thanks again for all the help!
|||

AMO doesn't provide the list of supported columns for a particular trace event. But, there are 2 other places containing the associations:

- the "tracedefinition90.xml" file (search for it in "%ProgramFiles%\Microsoft SQL Server"). You will need to parse it to generate a user-friendlier map. But please note that this file might change in the future (probably not the xml schema, but columns/events might be added/removed/changed).

- SQL Profiler; when you create a new AS2005 trace, in the 'Trace Properties' window, see the 'Events Selection' tab (generated from the trace definition file)

Adrian Dumitrascu

|||

I don't have yet a sample VB.NET code for using AMO traces, but a work-around is to have a separate assembly containing the trace code (written in C# from the sample posted previously) and use this assembly from the VB.NET script task in SSIS.

Adrian Dumitrascu

|||

You could try running the sample code through one of the online C# to VB.NET converters (eg. http://www.developerfusion.co.uk/utilities/convertcsharptovb.aspx). They are not perfect, but they can get you pretty close.

I don't know if the event handling code will work inside an SSIS script task. In this case one option might be to configure the trace to log to a file.

|||

Thanks Adrian, the tracedefinitions90.xml looks like it could be very useful.

The other thing I just found was that by going File -> Export -> Script Trace Definition. I can get an xmla script that will create the server side trace.

This might suit my needs as I can configure the trace using the profiler GUI, script it out and then just get my app to execute the xmla and then connect to the server side trace.

|||

Hi,

I have created an analysis services project using SQL Server 2005, in which I have included a cube, dimension, data source and data view. Now using the Analysis services Browser tab of cube I can see the Pivot table exactly the way I want where I can drag & drop table fields as per my requirements. But I am struggling to display the same cube over the Web. Can any please tell me that how I can publish the contents of Cube i.e. Pivot table on a web application so that end user can use this. I want the same functionality, which I can see in the Browser tab of Cube in AS2005 i.e. user should have freedom to drag & drop the fields exactly like in Excel Pivot table.

Any help would be highly appreciated.

Thanks in advance.

|||

Take a look at the following link on Mosha's website. It contains a set of links to web-based browsers and applications. You can probably use them as a guide to developing your own custom web-based app for doing this (or perhaps use one of the listed applications directly).

http://www.mosha.com/msolap/util.htm#ThinClients

HTH,

Dave Fackler

Capturing ISS Log data

I am quite new to Reporting Services and need some help figuring out why i can't correctly capture the referrrer information in the IIS Logs.

As far as i know when you run the data extraction tool provided with RS it copies the logs into the staging db, from there it then copies all the data into the WSSFact table in the actual db.

I thought that if i entered a URL into the referrer table that when it populates the WSSFact table it would check to see if the referrer URL matches any of the entries in the referrer table and if so enter its id, otherwise enter the id for No referrer.

This seems to work fine for all existing entires in the referrer table but it ignores the new one i have added. Does anyone know if there is something else that i have to do or check?It sounds like you are using IIS tools. I am not aware of the WSSFact table and such. Can you provide a link to the tools you are using?|||

I am using the data extraction tool provided with Reporting Services. The problem is you can't see what this tool does, therefore its difficult to trace the process of how it reads the logs and places the information in the database.

Like i said i am pretty sure it places the log information into a staging database and then from there into the actual one used by to generate the reports.

What i need to know is why it keeps showing as not having any referrer information in the database when you can clearly see there is info in the logs.

Sorry if i wasn't clear the first time.

Thursday, February 16, 2012

Capabilities Question

I am very new to SQL Reporting Services and trying to determine it's
capabilities. I developed a data-entry application. This application has
extensive business logic that summarizies and formats the data from the
database (including many calculations that I would rather not repeat in
another location).
My question is this... Can I tie a Report created with MS Reporting Services
to one of functions in my business logic. Or can I send the data from my
business logic to a reports?
If either is possible what would be the best way to go about implementing
thisREporting Services can consume a web service, data set or XML file as its
data source.
Also an RS report can be called from a URL directly...
I suspect you have or can create a web service to provide the data, and you
will be good to go.
--
Wayne Snyder MCDBA, SQL Server MVP
Mariner, Charlotte, NC
I support the Professional Association for SQL Server ( PASS) and it''s
community of SQL Professionals.
"matchbx" wrote:
> I am very new to SQL Reporting Services and trying to determine it's
> capabilities. I developed a data-entry application. This application has
> extensive business logic that summarizies and formats the data from the
> database (including many calculations that I would rather not repeat in
> another location).
> My question is this... Can I tie a Report created with MS Reporting Services
> to one of functions in my business logic. Or can I send the data from my
> business logic to a reports?
> If either is possible what would be the best way to go about implementing
> this
>|||Thank you for such a fast response.
Just one more quick question. I'm sorry I did refer to a version. Will
this method work for both 2000 and 2005 or just for 2005.
"Wayne Snyder" wrote:
> REporting Services can consume a web service, data set or XML file as its
> data source.
> Also an RS report can be called from a URL directly...
> I suspect you have or can create a web service to provide the data, and you
> will be good to go.
> --
> Wayne Snyder MCDBA, SQL Server MVP
> Mariner, Charlotte, NC
> I support the Professional Association for SQL Server ( PASS) and it''s
> community of SQL Professionals.
>
> "matchbx" wrote:
> > I am very new to SQL Reporting Services and trying to determine it's
> > capabilities. I developed a data-entry application. This application has
> > extensive business logic that summarizies and formats the data from the
> > database (including many calculations that I would rather not repeat in
> > another location).
> >
> > My question is this... Can I tie a Report created with MS Reporting Services
> > to one of functions in my business logic. Or can I send the data from my
> > business logic to a reports?
> >
> > If either is possible what would be the best way to go about implementing
> > this
> >

Tuesday, February 14, 2012

Can't use TAB key in SQL Pane

Hello folks,
When working in Visual Studio 2005 Reporting Services, I have been
cursed with a small problem that I have run out of remedy ideas for.
On the data tab of a report I am no longer able to use the TAB key on
the keyboard to format my SQL. I say no longer because i was using
Visual Studio 2003 until recently and this problem did not exist. If
I hit TAB when writing code in the SQL pane the cursor just moves to
the next action object (button) as if on a form. The only band-aid
solution has been to write all my code in a SQL Management Studio
query window and than copy/paste it into the report SQL pane but this
is a nuisance, especially for short,easy report queries and when
returning to existing reports for upgrades or bug fixes. Another
workaround has been to copy a single TAB from Notepad or any other app
and paste the tab in the SQL pane when needed, but than i have to re-
copy it each time if i copy something else. Any ideas or
sympathizers, I would love to hear from you.
Thanks, and here is an example of what I mean.
/* this is what I am stuck with */
SELECT
foo.Column1,
foo.Column2
FROM
dbo.foo
/* this is what I want */
SELECT
foo.Column1,
foo.Column2
FROM
dbo.fooNo way t o use tab, you need to use spacebar with space, I understand if it
is a small query you can do it, but if it is a big query will be very
tedious.
what otherway you can do is, just click "generic query builder" and again
click what it does is, it indends automatically.
Amarnath
"Skilliam" wrote:
> Hello folks,
> When working in Visual Studio 2005 Reporting Services, I have been
> cursed with a small problem that I have run out of remedy ideas for.
> On the data tab of a report I am no longer able to use the TAB key on
> the keyboard to format my SQL. I say no longer because i was using
> Visual Studio 2003 until recently and this problem did not exist. If
> I hit TAB when writing code in the SQL pane the cursor just moves to
> the next action object (button) as if on a form. The only band-aid
> solution has been to write all my code in a SQL Management Studio
> query window and than copy/paste it into the report SQL pane but this
> is a nuisance, especially for short,easy report queries and when
> returning to existing reports for upgrades or bug fixes. Another
> workaround has been to copy a single TAB from Notepad or any other app
> and paste the tab in the SQL pane when needed, but than i have to re-
> copy it each time if i copy something else. Any ideas or
> sympathizers, I would love to hear from you.
> Thanks, and here is an example of what I mean.
> /* this is what I am stuck with */
> SELECT
> foo.Column1,
> foo.Column2
> FROM
> dbo.foo
> /* this is what I want */
> SELECT
> foo.Column1,
> foo.Column2
> FROM
> dbo.foo
>

Friday, February 10, 2012

Can't uninstall Analysis Services 2000

I have both SQL 2000 and SQL 2005 on my computer. I am running Windows XP Pro, SP2. SQL 2000 was installed first, then, 3 months later, SQL 2005 was installed, too.

My client needs me to work with SQL 2000 Analysis Services (my client is on a SQL 2K platform). I have the full SQL 2005 Developer Edition on my machine, along with the SQL 2005 Analysis Services, SSIS, Visual Studio, SSMS, etc. I also have SQL 2000 Developer Edition, but I don't see SQL 2000 Analysis Services on the machine nor running under services. In addition, there is no Analysis Services on my machine.

Therefore, I wanted to install SQL 2000 Analysis services onto my machine. However, when I do, I get the message:
"To install a new version of Analysis Services, you must first remove your existing version."

However, I cannot uninstall Analysis Services. It does not show up under Add/Remove New Programs in Control Panel. There is no MSSQLServerOLAPService service running. I do have a two Analysis Service services running with other names: BUCKNOFF2005 (which is, obviously, my 2005 Analysis Services) and MSSQLSERVER, which also displays in my SQL 2000 SQL Server Service Manager, so there might be some artifacts from an old install of SQL 2000 Analysis on my machine.

SQL 2005 Analysis Services runs fine, by the way.

So I am stuck. I can neither install nor uninstall. Bottom line, how can I uninstall SQL 2000 Analysis Services (without reformatting my hard drive or starting over again on another computer)? If I can do that, then I can reinstall it. Right now, as a temporary solution, I borrowed a laptop from my client and installed Analysis Services 2000 for the 2 days that I will be working with it -- but I need to get this fixed on my own laptop which I take from client to client.

AS 2000 should have separate entry in Add/Remove programs "Microsoft SQL Server 2000 Analysis Services".

If you dont have the entry, you dont have AS2000 installed on your machine.

Now about installing AS2000 on top AS2005.

You can try uninstalling SQL Server 2005 from your machine, installing AS2000 and then installing SQL 2005 back into the same configuration.

It is bit of the hassle, but looks like your are trying to fit pretty custom configuration into your laptop and you might need to work a bit harder to get there.

Hope that helps.

Edward.
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||Hi,

Microsoft should warn people about this kind of things!!! It is completly ilogic and in terms of development it's a ***.

Best Regards

Jo?o Marto