Search every SQL table for a string

Here is some neat SQL to allow you to search every table and every field in the database for a string

CREATE TABLE myTable99 (TABLE_NAME sysname, COLUMN_NAME sysname, Occurs int)
DECLARE @SQL varchar(8000), @TABLE_NAME sysname, @COLUMN_NAME sysname, @Sargable varchar(80), @Count int
SELECT @Sargable = 'There are too many subscription products resulting from the supplied request data'
      WHERE c.DATA_TYPE IN ('char','nchar','varchar','nvarchar','text','ntext')
OPEN insaneCursor
                        + '''' +  @TABLE_NAME + '''' + ','
                        + '''' + @COLUMN_NAME + '''' + ','
                        + 'COUNT(*) FROM [' + @TABLE_NAME  
                        + '] WHERE [' + @COLUMN_NAME + '] Like '
                        + ''''+ '%' + @Sargable + '%' + ''''
            --SELECT @SQL
            IF @@ERROR <> 0 
                        SELECT @SQL
                        GOTO Error
SELECT * FROM myTable99 WHERE Occurs <> 0 
CLOSE insaneCursor
DEALLOCATE insaneCursor
DROP TABLE myTable99

Switching from iPhone to Android

The iPhone is the top smartphone, but some Android rivals like the Galaxy S III are very attractive, and they’re available in large sizes that the iPhone is not. Plus, they support cool technologies Apple doesn’t support.

If you’re ensconced in the Apple fold, you may believe you have to stay all-Apple. It turns out that you can bring Android largely into the Apple ecosystem.

Getting iCloud email

Apple’s iCloud sync and cloud storage service is one of iOS’s and OS X’s key attractions. But Apple keeps it in the family to encourage people to commit. However, you can access iCloud email from the standard Android Email app.

The key is to sign in using your iCloud account’s address, not your address. The incoming server is, and the outgoing server is SSL should be on.

Syncing iCloud contacts and calendars

iCloud’s auto-syncing contacts and calendars make it supereasy to keep your Mac, iPhone, and iPad up to date with each other. They even work with Windows — but not Android.

That is, unless you buy two utilities for £3.75 each from developer Marten Gajda: Smoothsync for Cloud Calendar and Smoothsync for Cloud Contacts. Both are available in the Google Play app store.

Sign in with your iCloud credentials, and your Android smartphone is now part of the iCloud family. 

Syncing documents

Apple’s iCloud Documents feature in iOS — recently brought to OS X — can be very handy for keeping documents in sync across all devices you use to access or edit them. It’s an Apple-only feature for which there is no way to gain foreign access.

But that’s OK. iCloud Documents is quite limited, requiring the same app on each device to read a particular file type. Many apps in iOS aren’t on OS X, such as OS X’s TextEdit text editor, so iCloud Documents often can’t do the job.

You should use Google Drive or DropBox instead; many iOS apps support them natively, and they work on pretty much every mobile and desktop OS today.

Syncing bookmarks and open URLs

Apple’s Safari 6 in iOS, OS X, and Windows has a neat feature called iCloud Tabs that syncs the URLs of all open tabs to all other devices using Safari 6 tied to the same iCloud account. Bookmarks are also synced across these three OSes.

Again, there’s no way to open up Safari’s iCloud tabs and bookmark syncing to Android — so don’t use Safari. Google’s Chrome browser has a similar sync capability, and it’s available for Android, iOS, OS X, and Windows. (Firefox can also sync across platforms, but recently dropped its iOS sync app; it’s not an option if you’re using an iPad or other iOS device.)

Find a lost or stolen smartphone

Another great iCloud feature is Find My iPhone, which tracks your iOS and OS X devices, so you can find them on a map, send an alert (in case your phone is hidden under a blanket, for example) or message, and lock or wipe them if necessary. Just be sure you set the device so that a thief can’t turn off this feature. Again, Android can’t join in.

But there’s a comparable service called Lookout that lets you find, lock, or wipe a missing Android device from any browser. The basic version is free. However, be warned that it’s easy for a thief to disable it if he or she notices it’s installed.

Syncing with iTunes

One of Apple’s stickiest technologies is iTunes, which is both a library for your entertainment and store from which to get more of it. Google’s free Music Manager app for Windows and OS X syncs nonprotected music wirelessly to your Google Play account, but it must be streamed to your Android device.

A better choice is the free DoubleTwist Player app, which syncs music, videos, and photos. Also, it can transfer these items from iOS device to Android. You need both the Android client and OS X or Windows client. Note that DoubleTwist is full of come-ons for in-app upgrades — annoyingly so. The $5 AirSync add-on is worthwhile, as it allows Wi-Fi syncing between your computer and Android device.

Streaming to AirPlay

Apple TV is an insidiously useful device, acting as a wireless bridge between Macs and iOS devices for screen mirroring and streaming of movies, music, podcasts, and photos. It too is an Apple-only technology.

But the £5 AirSync add-on utility for DoubleTwist lets you stream music and videos from an Android device to the Apple TV, just as if it were an iPhone or iPad. When it works, that is — I often could not get the AirTwist streaming icon to appear, and I never did figure out why.

Managing book libraries

iTunes includes the iBookstore, which lets you buy e-books for reading on the iBooks app on an iPad or iPhone, but iBooks doesn’t work on other devices, not even Macs. Except for the special Multi-Touch e-book format for the iPad, it’s not a great bookstore to use.’s Kindle app is a better choice, as it works on every major mobile and desktop platform, and its book selection is much larger than Apple’s.

Getting directions

Everyone knows by now that iOS 6’s Apple Maps has major flaws, and Apple has apologized for them. Plus, it provides voice navigation only on an iPhone 4S or iPhone 5. Compare that to Android, whose navigation app has worked well for several years on all Android devices.

But an even better option is the free Waze app; it’s available for both iOS and Android. It provides voice navigation on older iPhones, too.

Getting apps

It’s a cliché, but a true one: In iOS, there’s (very likely) an app for that. Android has a smaller app selection. But you’ll find that content apps and services apps (such as for banking, public transit, and airlines) are almost always available for Android if available for iOS. Ditto for basic utilities such as flashlights, social media, restaurant finders, and bar-code scanners.

Have I gone to the dark side and switched over yet, no, I’m still running my iPhone 4s and Google Nexus 4 together.  So I’m still sitting on the fence, perhaps the Samsung 4 will tip me over, we’ll just have to wait and see.

Disable Shut Down on your Server

When you are connecting via a remote connection to a server I find the Shut Down is far far to close to the log off, and if you hit the Shut Down by mistake it can be a devil to get the remote machine to power back up and may require someone to visit the machine to hit the power button.

You can disable the Shut Down button there is a group policy settings for this, start gpedit.msc on the machine or use a domain policy to configure User Configuration – Administrative templates – Start menu. See the setting “Remove and prevent access to the shut down, restart….”, change it to enabled.

No more shutting down by accident.