Category: SQL Scripting

  • A Progress Bar for SQL Scripts

    A Progress Bar for SQL Scripts

    Last year, I was running cursors against massive datasets, and they seemed to run forever. It was like watching paint dry or grass grow, because, while SQL Server Management Studio shows the time elapsed and a running ticker of (1 row(s) affected) messages, there is no indication of what percentage of the dataset has been processed. So I ended up developing this progress bar in SQL to add to my scripts.

    (more…)
  • Quick, Hide the Money!

    Quick, Hide the Money!

    When preparing for training sessions, it is a good idea to elevate your users’ permissions so that they can fully participate in training. However, this can expose users to highly sensitive information – such as valuations – that they would not otherwise have access to. This makes it necessary to hide the money.

    (more…)
  • Standardizing your Constituent Phone Numbers

    Standardizing your Constituent Phone Numbers

    Did you ever notice that American and Canadian phone numbers are both prefaced with the international calling code of “1”? This is because twenty countries, primarily in North America and the Caribbean, participate in the North American Numbering Plan (NANP). Let’s examine how these numbers are structured, establish standards for data entry and then apply those standards to our existing records.

    (more…)
  • Perpetual Calendar: Updating a Date Field in a Saved Query

    Perpetual Calendar: Updating a Date Field in a Saved Query

    I have a saved query in TMS that I run every day. And every day, I have to change the date field to reflect the current date. Perhaps in the future, Gallery Systems will provide a new relationship “Is Today” for date fields, but until that happens here’s a hack to try.

    (more…)
  • Improving the Quality of your Constituent Addresses

    Improving the Quality of your Constituent Addresses

    Since we do not tend to include the country name when addressing domestic mail, users tend to forget to enter this into the Constituent address. Having the country specified can enable you to perform certain queries, such as what is the geographic distribution for outgoing loans in a given year, and enables better formatting of the display address. Here are a few scripts I use for managing periodic maintenance on addresses in my database. (more…)