• Microsoft - SQLServer

    How Not to Perform a Difficult Update in SQL Server/Azure

    I learned a long time ago, that the quickest way to do something was to not do it at all. A friend of mine asked me if I could review an update statement that was confounding their group looking for ways to optimize it. The table has, just short of 50 columns, a considerable number of indexes and the column in question, has a datatype set to NVarChar(8), consists of some numbers, combinations of letters and numbers, etc. The process would take 7 ½ hours to run this update, as it parses through 100K rows at a time. There is…