• SQL Server 2005, once I changed the max to 8000 it runs without error. But of course, it only gets halfway throught the first 2 tables.

    The query is running against a SQL Server 2000 instance though, I didn't think about it before. I new max was new to 2005.

    I'm not sure what this is doing. It looks like every "select @final_sql" is selecting the same table and column code.

    Is this what it is suppose to do? Or do I need to add some code to make it work?

    Thanks again,

    Wes