Monday, March 26, 2012

How to get the resulting XmlaWarningCollection in AMO Process?

Hi,

I'm trying to do an unattended cube processing using AMO, and I simply want to let the user know that warnings and errors occurred (and how many of them) without necessarily stopping the process.

Looking at the Cube.Process method overloads, you'll find out that it is possible to pass an XmlaWarningCollection that, allegedly, should return a warning collection populated with them.

When coding that, the collection is always returned as an empty one (0 items). Again, I'm suspicious that only warnings are allowed and not XmlaError objects or generic XmlaMessages, guessing that I'm misunderstanding the issue.

Alternative methods, like subscribing to a Trace looks overkill due to the roundtrips involved. Saving to a log file and parsing it sounds too much work for something apparently trivial...

Any additional info or suggestion?

TIA.

Jordi Rambla

SQL Server MVP

Hi Jordi,

I just checked and I think you are out of luck with the xmlaWarningCollection. I put an invalid record in a fact table for a test cube. When I process it through the BIDS UI I can see the warnings, but the collection in AMO was always empty. So I "cracked" open AMO using reflector and I found the following:

I started at Cube.Process(...)|||

Thanks for the testing, Darren.

I know about the two paths you suggest. They are the ones I'm hoping could be avoided.

The first one does not fit because the log file will be in the server, AFAIK.

The second one might be killing for network roundtrips if you have many errors (as happens some times).

I guess this is a wish to send to Microsoft.

Saludos,

Jordi Rambla

|||

Yes, I believe the log file would have to be stored in a drive on the server, or at least in a location that the server has access to. I honestly don't know what the network traffic is like with the tracing API, but if you don't need that "real time" feedback that you get from tracing then it is a lot of extra work just to get a list of errors/warnings.

The best place to log this is on http://connect.microsoft.com. If you log it there you could post a link to the item back to this thread so that anyone else that has the same issue can look up the item and view it's status and even vote for it to be addressed.

Cheers
Darren

|||

Filed.

https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=256428

Best regards,

Jordi

|||

Cool, I have added a validation and put in a vote. Even though you logged the issue you might want to add a vote too.

Cheers
Darren

sql

No comments:

Post a Comment