Wednesday, March 21, 2012

PostExecute() and Cleanup()

So when do I use which and why? BOL pretty much makes them the same but I figure there must be a difference rather like PreExecute is the first opportunity to get our hands on the BufferManager so maybe PostExecute is our last chance?

Thanks

AllanHi Allan,

In general PostExecute and Cleanup are the same and as a rule of thumb anything you did in PreExecute you cleanup in PostExecute and anything you did in PrepareForExecute you clean up in Cleanup. However, that is not required. You might ask why there are two if they are the same. The answer is that there were thoughts about using one as a one shot and the other as called every time (think looping). However, currently this is not the case and they are interchangeable just as PrepareForExecute and PreExecute.

HTH,|||Hi Matt

Yes that was a Q i was asking myself but thanks for clearing this up.

Allan

No comments:

Post a Comment