• "sp_MSforeach.." procedures are undocumented and according to Microsoft are for Internal use only.

    If what you are trying to do is an Adhoc requirement then it is fine to use this method. But if it is going to be a part of a routine then it is certainly not advised to use it.

    There must be some reason that Microsoft has kept these procedures undocumented and the first reason I can think is the reliability of these procedures in certain scenarios.

    So, my advice would be to avoid "sp_MSforeach.." procedures and use the script if its a routine requirement.

    Vinu Vijayan

    For better and faster solutions please check..."How to post data/code on a forum to get the best help" - Jeff Moden[/url] 😉