Category Archives: Work

Order SQL query manually when numeric string representation is out of order

Order/Rank by your own criteria

In some instances, doing a straight ORDER BY ASC (OR DESC) does not work as one might want: 0-50 101-200 201-300 301-400 401-500 501-600 51-100 601+ That is not how humans do it 😉 A way to get around this, is to add a new column and put in an ordering value, for instance: 1. 0-50 2. 51-100 3. 101-200 4. 201-300 5. 301-400 6. 401-500 7. 501-600 8. 601+ Now that is much better Here is a real world

Disable Skype voicemail [SOLVED]

Click the slider to disable voicemail

I use a Google Voice number in conjunction with Skype. It allows me to receive calls at home via satellite internet. However, when I miss a call I want Google to take the voicemail not Skype. Thankfully, the steps for disabling Skype voicemail are fairly easy. First, go to the following URL: Second, click to uncheck the voicemail setting: That is it, Skype voicemail is now disabled! *PS you may have to disable this annual, as I believe certain Skype

SQL Server: list all user defined functions in a database

List of all user functions!

Recently I inherited a database project where many of the functions were not listed nor documented. Thankfully, with the help of the always useful stackoverflow, I was able to find the following snippet for displaying all user functions: select name, definition, type_desc FROM sys.sql_modules m INNER JOIN sys.objects o ON m.object_id=o.object_id where type_desc like ‘%function%’ via sql server – SQL list of all the user defined functions in a database – Stack Overflow. Very cool!

Create PayPal subscription buttons [SOLVED]

PayPal subscription button page

Since PayPal came up with their new ‘streamlined’ interface, it seems to have made some core features very difficult to find A prime instance is the subscription buttons and links. These tools are very useful for webmasters and anyone offering recurring services online. Here is how to find the subscription tools: #1 Login to PayPal: #2 Go to the ‘Buttons for subscriptions and recurring billing‘ page #3 Click ‘Create your button now‘ (you must be logged in for the

Format SQL code

This gets hard to read, we need to tidy/beautify this code! :-)

I have been writing copious quantities of SQL lately. Some of the queries are getting really long. When I am working with Navicat it has a nice ‘SQL beautify’ feature that takes messy SQL and makes it nice and tidy. While that features is great when using Navicat for SQL editing, sometimes I need to workdirectly with SQL Server 2008 there is no comparable feature built into Microsoft’s SQL pane. Thankfully, with a quick copy/paste there is an online tool that can

Select top 2 rows from records, grouped/partitioned by Unique ID

Shows the records with their new ROW_NUMBERs added and paritioned

The Problem: A client needed a query that selected the two most recent tour dates for each user ID. This is an easy task for a single user ID because specifying the user ID and an ORDER BY tour_date DESC with a LIMIT 2 clause would get the dates needed. However, when there are a lot of users it gets harder. For a single date, the MAX function works great but in our instance it will not work because we

GoDaddy changes manual renewal to auto-renewal. Lame.

GoDaddy will change your manual renewal domains to auto-renewal without asking you first :-(

GoDaddy: “Unless you have specifically selected the manual renewal option, your purchase includes enrollment in our automatic renewal service” This domain was set to manual renewal and I did not even notice an option during the checkout process to “keep” it that way, instead GoDaddy automatically set it to automatic renewal I am not a fan of that. On renewal why not have leave it at the domain’s previous renewal designation?

Page 2 of 1912345...10...Last »