Paul Bradshaw's blog

Finding Data in the Database

It's sometime useful to search an entire database to find out where some specific data is... for instance, you entered data into the UI but you aren't sure where it got stored.

This post contains a SQL Script to search a database for any specific string in any column in any table in your database.

To use this script, simply edit the first line to set the @value variable to the string you wish to search for (see the comment).  You can include "%" as the standard SQL Wildcard character.  As is, the script will search for any string starting with "C:\" ... but you can use exact strings or any arbitrary string you wish.

Refreshing View Meta-Data Revisited

Just updating and re-emphasizing a previous blog post about refreshing view metadata (see previous blog post).

Future iMIS Database Upgrades will validate all view metadata by running the script in my previous Blog entry on the subject (reproduced below).  Therefore, it's vitally important that all existing iMIS users run this script against their databases prior to upgrading to the next major version of iMIS in order to avoid errors during the database upgrade.

Refreshing View Meta-Data

When database schema changes, as it often does during upgrades or customizations, any existing views refering to that schema remain unaltered.  For example, if a UserId field is lengthened from 30 to 60 characters in the schema, any view referencing that field will remain at 30 characters.  The solution to this, short of editing all the views, is to call sp_refreshview on the view.

The following is a little script that can be run on your database.  It will refresh the views for all schema objects in the 'dbo' schema (which includes all IMIS tables).  If you have a lot of tables in your database that exist in other schemas, you may wish to eliminate the clause that limits the script to only 'dbo', in order to ensure everything is refreshed and up to date.  This can be run at any time, and it is completely non-destructive.  If this script throws any errors, it's likely due to the existence of old obsolete views that reference schema that has either been renamed or dropped... you'll have to manually fix such issues by either fixing or dropping the offending view.

Validating User Logins for iMIS 15.0.x to 15.1.x upgrade

The way user logins are handled and stored has changed in iMIS 15.1

In this new version of iMIS, all your users (logins in the Name_Security table) will have matching records in the UserMain table. Importing all these users into UserMain can have a snag though: it's possible for there to be the same login ID in Name_Security as one already specified in UserMain. That is, two separate logins could exist with the same login id. This is no longer the case.

SQL to help validate 10.6 DB is ready to upgrade to 15.x

The following SQL script can be run on any 10.6 database to validate that some specific, common data problems that would interfere with a smooth upgrade to 15.x are not present. If any issues are present, they are displayed. If you run this from SQL Query Analyzer or SQL Server Management Studio, set the "results to text" option before running this script, for the best display of the results.

Turning Off Smart-Quotes in Outlook 2007

I typically find myself typing actual code into many emails, and get annoyed when Outlook replaces my single and double quotes with the curley "smart-quotes"... as this makes cutting/pasting without syntax errors painful. So after a little digging, I found out how to turn smart-quotes off in Outlook 2007:

  1. In the main Outlook window, on the Tools menu, click Options.
  2. In the Options dialog box, click the Mail Format tab, and then click Editor Options.

Handy utility for Windows XP users: Taskbar Shuffle

If you’ve ever wished you could change the order of your application buttons in the task bar, or have ever wanted to just drag and drop your taskbar buttons around so you could have them in the order you want, this utility is for you.

Also, if you’ve ever wished you could have control over taskbar button grouping and when/if they ever collapse into one button, this utility is for you.

Tip of the Day: Refresh Rates and ClearType

Staring at a monitor all day, or even part of the day, can be very hard on the eyes.

If you're using a CRT display, one of the easiest things you can do to relieve eye-strain is to up your monitor's refresh rate. By default, your monitor is strobing at you 60 times a second. Pushing that up over 70 times a second will ease the strain on your eyes enormously, even if you can't "see" the flicker. To change this in Windows XP, just do the following:

Syndicate content