• This has got to be a wind up ...

    ... if it isn't why not simply fix the dynamic sql to look like (after creating the CustomerMaster table) ....

    IF Exists(SELECT Customer FROM CustomerMaster WHERE Customer = @Customer)

    ELSE

    Then fix the Customer insert to use CustomerMaster and instigate a background process to "migrate" rows from the old to new table.

    Of course I expect each Customer will have an integer PK Identity column just to make matters worse!!!