Monday, 5 March 2012

Notebook security - password protecting your hard drive

As a mobile worker for a government agency, I am constantly aware of the vulnerability of my notebook. The portability that I value so highly also makes it an easy target for thieves in places such as airports, cafes, and even serviced apartments and shared offices. Not only is the actual device more vulnerable than a desktop PC, the data stored on the hard drive needs to be secured as well.

Convert dates to Salesforce format in T-SQL

When preparing csv files for import through the data loader, it is best practice to format the datetime values in the full yyyy-mm-ddThh.mm.ss.sssZ format required by Salesforce.com. This prevents any complications with Data Loader or other migration tools which may have different settings depending on the environment or installed software (for example, dates can be scrambled if your data loader has 'Use European Date Format' checked, but your client's data loader does not.

CONVERT float to nvarchar

Attempting to compare company numbers (e.g. ABN) stored as datatype float to text strings is complicated by the fact that the default display for float numbers over 6 digits is scientific notation. To work around this you need firstly to convert the float to a bigint, then convert to nvarchar.

Wednesday, 29 February 2012

Spring bean variables with data loader command line

If you use Apex Data Loader from the command line, you will know that changing usernames, passwords, and environments is a bit painful if you have more than one bean in your process-conf.xml file. Adding variables should be easy but getting the syntax right without an IDE is not. I couldn't find much help on the web so a Java guru colleague came through with the following fix.

Sunday, 26 February 2012

Using Google Analytics in webs.com

The latest version of the Analytics tracking code offers an improved way to track website visitors with Google Analytics. It takes advantage of browser support for asynchronous JavaScript to enhance the speed in which the tracking code is loaded.

Saturday, 25 February 2012

Differences between views and temp tables

In a relational database like SQL Server, views provide a way of giving users a way to work with specific portions of a larger schema. Temporary tables are another means of providing end users with a subset or collation of data from base tables, and at first glance it seems that these are similar methods of achieving the same end. So it is important to understand what the difference is between a view and a temp table.

Thursday, 23 February 2012

T-SQL not equal to NULL

This is a well known problem addressed elsewhere, but I want to log it here anyway. When joining two tables and checking for records where a value in one does not equal a value in the other, T-SQL fails to find records where the reference table has recorded a NULL value. Presumably this is because a NULL value is unknown, so there is no way of knowing whether the two values are equal or not.