Yossi Dahan [BizTalk]


Tuesday, May 29, 2007

bm update-all

We've been using BAM for a while now, and reached the point we need to add more data to our tracking profile.

No problem, we thought, as the 2006 version of bm.exe has this shiny new update-all feature that would solve all of our problems.

Either we or MS missed something big-time (and as much as I'd like to think it's not me I do realise most chances are that it is, so plese do correct me if I'm wrong) -

Our first attempt was very naive - we've simply opened our bam excel spreadsheet, added the activity item to the activity, updated the view we had to include the added field, saved the spreadsheet and used bm.exe update-all -definitionFile: hoping to get it all updated in the database.

Only that instead we got the following error:

View "" has a different definition XML from the one already deployed. The view cannot be updated.

At first we thought - DUH! - of course it is different - we just changed it! isn't that the whole point of update-all??

but further playing around revealed that the main point in that error is the word view - while bm.exe will quite happily add items to activities it is not at all happy to update views (I'm guessing the difference lies in the difference between add and udpate, but I'm not at all sure).

To prove this, we went back to the spreadsheet and manually returned the view to it's previous state - the one before we added the extra field; the activity still had the additional item though.

We re-executed bm.exe as before and this time it worked liked a charm. the new field was added to the activity (with all values being null, of course). the view, as you can expect, did not change.

This is good news as we can indeed add fields to our activities, but this is only half the solution as we can't update the views to see them; I don't know of any other way to update the views, surely there must be some solution other then mofifying them by hand? and so - as I've said - either I've missed something big time or MS has.

I found a newsgroups thread in which Ekta Aggarwal [MSFT] suggests deploying the view with a different name, which does work, but, at least in our case, changes everything that uses that view which is less than ideal to say the least (as well as leaving a trail of unwanted views that now have to be removed).

BTW - I'm not sure how this will work in conjuntion with archiving, but already I've spotted a further challange once the data has been partitioned -

if you run the DTS/SSIS job that partitiones the completed tables, and then try to update an activity you get a different error:

All queries combined using a UNION, INTERSECT or EXCEPT operator must have an equal number of expressions in their target lists.

I suspect this is because an attempt is made to modify the tables while the views have a union to the partitioned versions.
The only way to overcome this (I think) is to manually remove the union from the views first, update the activity using bm.exe and then re-add the union making sure to add the extra field but this is much more manual editing of the views than I would like to do.

Labels: ,


  • All you need to do is make sure you call remove-view first, then update-all will successfully update the activity and recreate the view without losing any data!

    By Anonymous Anonymous, at 10/04/2008, 21:34  

  • Thanks Dan, this is very useful.

    I knew I couldn't be right about this, but simply could not think of the answer. glad you did, and let us know.

    By Blogger Yossi Dahan, at 11/04/2008, 08:58  

  • When the activity data is partitioned, removing the view does not fix the problem. Find the solution here.


    By Anonymous Stijn, at 11/05/2009, 16:44  

Post a comment

<< Home