• Original post mashed the code frag...

    Frank Hamersley (12/8/2008)


    ... 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)

    SELECT data FROM CustomerMaster WHERE Customer = @Customer

    ELSE

    [Build the usual dynamic SQL]

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

    I take your point about avoiding if possible a big bang changeover - but it may not be avoidable. If not you will just have to re-engineer from the ground up. To take my previous posts building analogy you may have to almost tear down the entire building and start again.

    Cheers, Frank.