Entries for month: February 2010

A list of robots.txt requests

I get an email every now and then, from the sites which are hosted by me (and use my Xitesystem cms). In this email I get a complete list of all requests for the robots.txt file on that particular site. This way I can scan through the bots that have visited the site.

No Comments

Change SQL Server bit field to the opposite value: "NOT bit_fld"

I had a DB column named 'mai_confirmed' (confirmed for mailing), but I needed a column with the value for 'needsConfirmation' for a mailing component.

Or, to say it codish: needsConfirmation = not mai_confirmed

I tried SELECT !mai_confirmed AS needsConfirmation, and also SELECT (NOT mai_confirmed) AS needsConfirmation, but those didn't work.

The trick is:

SELECT mai_confirmed + 1 % 2 AS needsConfirmation

Even though the resulting value is not a bit field anymore, it does return either NULL, 1, or 0. Which was fine enough for me ;-)

9 Comments

removed-superheterodyne