Rob Farley

Rob Rob Farley has been consulting in IT since completing a Computer Science degree with first class honours in 1997. Before moving to Adelaide, he worked in consultancies in Melbourne and London. He runs the development department in one of Australia's leading IT firms, as well as doing database application consultancy and training. He heads up the Adelaide SQL Server User Group, and holds several Microsoft certifications.

Rob has been involved with Microsoft technologies for most of his career, but has also done significant work with Oracle and Unix systems. His preferred database is SQL Server and his preferred language is C#. Recently he has been involved with Microsoft Learning in the US, creating and reviewing new content for the next generation of Microsoft exams.

Over the years, Rob's clients have included BP Oil, OneLink Transit, Accenture, Avanade, Australian Electorial Commission, the Chartered Institute of Personnel and Development, the Royal Borough of Kingston, Help The Aged, Unisys, Department of Treasury and Finance (Vic), National Mutual, the Bible Society and others.

Did you mean to come here? My blog is now at

08 October 2006

Moving / merging my blog

I'm looking to move my blog across to - if I can merge the two somehow, then I will do so, but for the time being please start also checking . The RSS feed will remain at .

05 October 2006

Fellow MVP (name dropping)

So far, one of the best things about being an MVP is access to the MVP newsgroups, where some of the heroes of SQL hang out. I'm not sure I'll fit in, but it is very flattering to have someone like Adam Machanic blog that I showed him something (of course, I'm sure this is a once-off).

04 October 2006

To be colleagued

I think there needs to be a new word in the dictionary, to describe those times when a colleague comes over to your desk and takes time from you. Actually, it might not be a colleague, and they might just take time from you in some other way, like via the telephone or an Instant Messaging system.

Obviously when someone colleagues you, it's urgent to them, and you have to treat it urgently too. It stops what you're doing for a few moments. It's not a bad thing - sometimes it can be just what you need to get a fresh perspective on the work you're doing, but it's definitely something which I think needs a verb. "Interrupted" doesn't describe well, because it has negative connotations. And besides, you could get colleagued for a long period if someone drags you into a meeting.

02 October 2006

MVP Photo

This is a decent list. Darren, Grant, Greg & Greg are all really great guys. I feel honoured to be a part of this crowd, and can't help but think that there are other names that should be there too.

I need to get a decent photo of myself sorted. Perhaps there will be someone at Wagga who is good at taking photos.

Rob Farley - MVP

More letters... These ones are certainly very nice. :)

I'll write more when I have time. I'm just leaving for the public-holiday church picnic.

30 September 2006

More on primes

I've changed my algorithm a bit, so that it starts with the low-hanging fruit.

insert into dbo.rf_primesfound (num)
select 2 union all
select 3 union all
select 5 union all
select 7 union all
select 11 union all
select 13 union all
select 17 union all
select 19 union all
select 23 union all
select 29 union all
select 31;

DECLARE @BigLimit int;
SET @BigLimit = 1000000;

DECLARE @Limit int;
SET @Limit = 32;
DECLARE @OldLimit int;
SET @OldLimit = 32;

DECLARE @Start datetime, @End datetime;

while @limit < @BigLimit
select @Oldlimit = @limit, @limit = @limit * @limit;
if @limit > @BigLimit set @limit = @BigLimit;

insert into dbo.rf_primesfound
select p.num
from dbo.nums n1
dbo.rf_primesfound f
on n1.num between 2 and @limit / f.num
right join
dbo.nums p
on p.num = f.num * n1.num
where f.num is null
and p.num > @Oldlimit
and p.num <= @limit;



SELECT @Start AS Start_time, @End AS End_time,
DATEDIFF(ms, @Start, @End) AS Duration,
COUNT(*) AS Primes_found, @Limit AS Limit
FROM dbo.rf_primesfound

select * from dbo.rf_primesfound

This gets down to 7 seconds, which isn't quite as good as Ward's 5. I do wonder what other improvements I could make, but I have a few other things to sort out this weekend (like my talk for the SQL Code Camp next weekend).


A challenge is always good. Ward Pond has a way of finding prime numbers.

My machine isn't as chunky as some, so my numbers are different. But...

I think Ward's performance largely comes from the fact that his starting point assumes he has found all the primes up to 31 already. So I adjusted his query a little, commenting out the section where he had all the previously done primes:

INSERT INTO dbo.Primes (Prime)
FROM dbo.nums
WHERE /*(num % 2 <> 0 OR num = 2)
AND (num % 3 <> 0 OR num = 3)
AND (num % 5 <> 0 OR num = 5)
AND (num % 7 <> 0 OR num = 7)
AND (num % 11 <> 0 OR num = 11)
AND (num % 13 <> 0 OR num = 13)
AND (num % 17 <> 0 OR num = 17)
AND (num % 19 <> 0 OR num = 19)
AND (num % 23 <> 0 OR num = 23)
AND (num % 29 <> 0 OR num = 29)
AND (num % 31 <> 0 OR num = 31)
AND */ num <> 1
AND num <= @Limit

..and having a different starting place for @Last

SET @Last = 1 --31

I set @Limit to 10,000, and it ran in 350 ms. His original query did it in only 60ms, which tells me that starting at 31 makes a massive difference, and is definitely a good idea. But let's see how another algorithm might compare, with both systems starting at 2.

I'm starting with a prepopulated auxiliary table of numbers, just as he did. I'm using the same counting mechanism as him.

DECLARE @Limit int;
SET @Limit = 10000;

DECLARE @Start datetime, @End datetime;

insert into dbo.rf_primesfound
select p.num
from dbo.nums n1
dbo.nums f
on n1.num between 2 and @limit
and f.num between 2 and sqrt(@limit)
and f.num <= @limit / n1.num
right join
dbo.nums p
on p.num = f.num * n1.num
where f.num is null
and p.num between 2 and @limit


SELECT @Start AS Start_time, @End AS End_time,
DATEDIFF(ms, @Start, @End) AS Duration,
COUNT(*) AS Primes_found, @Limit AS Limit
FROM dbo.rf_primesfound

select * from dbo.rf_primesfound

I set @Limit to 10,000, and my one ran in 170 ms.

Ok, so let's see how well they scale. Let's try for 100,000. Mine took 1673ms. His took 3243ms.

For 1,000,000, mine took 21 seconds. His took 55 seconds. But when I let him start at 31, his took about 5 seconds.

I think the difference comes down to the fact that Ward is going through the list one prime at a time, whereas I'm taking a set-based approach and just filtering them all out at once.
I feel like there would be ways of improving it even more, but will be someone else's challenge.

I definitely think the way to go is to start with the low-hanging fruit. Perhaps there are ways that I could improve mine to take a few steps to get the low-hanging fruit first... not today though.

29 September 2006

Ownership chaining

I've put an article together about ownership chaining at

Auxiliary table of numbers

There are all kinds of ways that an auxiliary table of numbers can be useful. Just today I used one to generate a bunch of test data.

If you want your own table of nums, try this:

create table dbo.nums (num int not null primary key);
insert into dbo.nums (num) select 1;
insert into dbo.nums (num) select 2;

create procedure dbo.topup(@max int) as
 if ((select count(*) from nums) < @max)
  while ((select count(*) from nums) < @max/2)
   insert into dbo.nums (num) select num + count(*) over() from nums;

  insert into dbo.nums (num)
  select n
  from (select num + count(*) over() as n from nums) t
  where n <= @max;

This will start your table off very small, but you can call the topup procedure every time you need it. For example, if you know you're going to need to have to it go as high as the number of rows in the blah table, do:

declare @newmax int
select @newmax = count(*) from blah
exec dbo.topup @newmax

--before your query that uses nums.

21 September 2006

SA Budget cuts

From the South Australia Budget (Government, not User Groups)...
Chapter 2, page 2.22.
(page 50 of 236)

"A significant savings measure arising from the Review of Priorities is the proposed abolition
of the Department for Administrative and Information Services....."

I wonder what kind of effect this will have on SA.

20 September 2006

Dev / ITPro wars

I listened to Nick Randolph's podcast this morning about user-groups. The first of his MSDev series at ThePodcastNetwork. Nick's a great guy, and it's great that he's picked up the mantle of doing this show.

During the show, it was said that most people at TechEd already know all about the Vista Roadmap, etc. That they've read that on people's blogs, etc.

But I think that the larger proportion of people are there because they've been SENT. But people GO to user-groups. The TechEd crowd may have put their hand up to go, but essentially, they're there because their employers are paying for it. They are not the people who are keeping up-to-date with technology. They go to learn. They go as a training exercise. A smaller proportion of TechEd attendees, of which anyone involved in user-groups would fall into, are there because they want to network, because they want to meet the experts. They go to meet. They go as a networking exercise.

Developers have a very different perspective on user groups to IT Pros and Managers. Managers are often wary of user groups because they fear their staff might get to know other employers and be taken away from them. But IT Pros are far more interested in best-practice than the creativity that goes with Developers. IT Pros are great people, but they often fall into the brick-layer analogy. Brick-layers are interested in the best way to lay bricks, and are certainly interested in the new ways of doing that. But they're not into the social scene like the architects, who are always looking for inspiration from their peers to improve their creativity.

And I think those are two of the keys words.

Inspiration and Creativity. Compared with Determination and Reliability.

Developers need the inspiration to be creative to do their job really well. IT Pros need the determination to be reliable. Of course, Developers need reliablity as well, but assuming that they meet the corporate standards of their workplace, the thing that determines who are the kings of the developer-world is the creativity. Similar attributes may include ingenuity and skill. These are all things that people get from sharpening against each other. But IT Pros don't need this as much. They need to have the set of rules to be able to implement their systems consistently, having the determination to resist creativity, and choose reliability instead.

Creativity and Reliability conflict with each other in many ways. It's the difference between the romantic and the faithful. The two can work together very well, but in the same way that young lovers will be disappointed with years of fidelity, missing the excitement of romance, the creative can be disappointed with the idea of doing something the tried and tested, reliable way. And people who are more concerned with reliability may shy away from choosing a creative solution, for fear that it may not have the same robustness as the way they used to do things.

SQL Server is an interesting tool. It is a back-end product. It is the realm of data storage. It is not a user-facing product. And yet, it is a product which involves a large amount of creativity. A database administrator (DBA) must choose the reliable option. A database developer (DBD) must also choose the reliable option. But a DBD is much closer in mindset to the Developer than the DBA. The DBA is much closer in mindset to the IT Pro than the Developer. SQL people have the two characters sitting on our shoulders. The cartoon devil and angel. The IT Pro and the Developer. The brick-layer and the artist. I'm not saying which is the devil and which is the angel, I'll leave that up to you.

The problem is that DBDs are not just developers. Typically, DBDs are part-DBA, part-Developer. This then presents an internal struggle. We want to be able to have the reliable, robust solution, and know the best ways of achieving this. And yet we want to find the creative ways to manipulate the data. If you can in some way separate the DBA aspects from the DBD role (of course you can't), then you find the DBD is trying to bend the rules, trying to work to find the exquisite query, a thing of beauty which can get the perfect resultset with performance never seen. It becomes the role of aeronautical engineer, working in the wind tunnel to find a beautiful design for a race car to get greater speed. The creativity is certainly present.

And yet when pushed, the DBD will insist on the reliability far more so than a standard Developer. And this is where the IT Pro aspect comes out. The most beautiful query in the world is ugly if it is not robust. Some Developers would have the same attitude toward their own code. But I think a DBD is more passionate about reliability.

Earlier I used the angel v devil analogy. There are many stories of the artist who sold his soul to the devil. In many ways, a SQL person is like the drummer in the band. Many musicians don't consider the drummer to be a real musician. As a pianist and guitar player, I have told jokes like "What do you call a guy who hangs around with musicians? The drummer!" But of course, the drummer is a musician. He doesn't just provide the backbone and stability of the music, he determines the flavour. It's the drummer's creativity that sets the mood, the drive, the passion, more than the soloist lead guitarist or saxophonist. Just please don't tell my friend Dave Branton of that I've said this. Despite the jokes, I know that when Dave plays, the music is different to when an ordinary drummer is there. The same applies for someone who really knows their databases. A good database can make or break an application.

It's interesting that the SQL groups in Australia run under a common banner, headed by Greg Linwood. We have a common site, we have sponsors at the top level, and that can then give financial assistance to the groups. It's particularly pertinent at the moment, as Microsoft are really pulling back on their budget for sponsoring the groups. The Developer community haven't been able to establish a common group in this way. And perhaps it's because of the creativity issue. Perhaps the fact that the SQL groups are able to work together is a reflection of our IT Pro nature. We're keen to do our own thing, but we also appreciate fully the requirement to adhere to standards.

Personally, I'm more DBD than DBA. I'm much more interested in going to a Developer group than a Sysadmin group. But yet, I run the SQL Group, and try to cater for both camps. I can assure you though - those people who make the effort to go to SQL Code Camp or TechEd are the DBDs in the group, not the DBAs.

19 September 2006

TTB seems fixed

Recently, my blog post entries haven't been appearing on TTB. But I can see a bunch appeared last night at 10:13pm. So I guess something got fixed somewhere.

From the MostRecent view (on various pages), I can see my site wasn't the only one that was being missed. Lots of entries from people all at the same time.

If you don't keep your eye on the TTB site, I really recommend you do. The fact that people in the community can give a 'thumbs up' to various posts really makes it a great resource. Thanks Frank, Mark, etc...

Not what it says on the box

A few months ago, Roslyn noticed something on the TV she liked the look of. Not learning from last time, I decided to get it for her for her birthday (today). She likes it. So that's good. But it's still a kettle.

It's the Russell Hobbs Thermocolor Kettle. The slogan says "as the temperature changes, so does the colour!"

But it's not true.

Sadly, there are clearly those that do. But not this model. Not the one I bought Roslyn. This one only changes colour to let you know what you're doing with it. So it's purple while it's boiling, and as soon as it's done boiling, it switches back to blue. We had to specifically tell the kids "Just because it's blue, it doesn't mean it's cold."

She still likes it - but I'm going to call up Russell Hobbs and have a bit of a chat about it. It certainly doesn't do what it says on the box. It does look good though, and I'm not sure if I actually want a refund. It just doesn't have the massive safety feature associated with it.

Interestingly, when I do a search on the Argos site (shop by catalog place in the UK), I can find the kettle I bought, described not as a thermocolour one, but as a Glow Kettle.

15 September 2006

Windows Mobile networking profile switching

The problem is that when you are somewhere that requires you to specify your WiFi connection's IP address, you need t change your settings from using DHCP. And you get sick of changing it manually! Like Dave Gardiner says, it would be useful to have a network profile switcher.

A friend at work recommends Says it's very good - and it certainly looks it.

Another option would be to roll your own. The registry contains the details. I use TRE registry editor, which tells me that HKLM\Comm\tiacxwln1\Parms\TCPIP contains the useful stuff for this. So it should be easy to write an app which alters the entries there, and prompts you to save the settings as a profile you could switch to later.

Of course, writing one isn't my highest priority right now, but I'll try to do it some time...

Helper outerers

Steve Jones from posted an editorial today asking about what you'd get someone to do for you if you could get a helper. He wants a chef/cook to be able to provide regular meals for him.

Personally, I'd like someone in my life to help me keep accountable for all the things that I'd like to do. I would return the favour, and regularly ask them how they're going with achieving stuff. I heard something recently (was it on Hanselminutes?) about the idea of detailing what the next step is for each goal you have. So, the next step in fixing the fence could be counting the number of palings you need to buy, after you've done that, you update the list with the next step. You also have things dated so that you can see the things that you're being slack on.

But of course, this is so much easier if you have someone who will ask you how you're going with it. I will be asking a few people to do this with me, and I hope it helps. I'm not bad at getting things done, but I would like to be better.

And of course, this is probably the type of thing that would like. :)

I think everyone needs a mentor in their life, and everyone needs people in their life who will keep them accountable to the things they want to be held accountable for. Of course, everyone has different things that they're trying to achieve. It might be dieting, quitting smoking, blogging more, keeping track of projects better, etc. But it's so much easier to do with help. Why not work out who you will help with things, and who you will ask for help from?

Value of being valued (MVP)

Yet another interesting post from Lemphers David. I know some people who consider MVP status something to be achieved. It certainly seems to have the highest ratio of usage on newsgroup forums - and by ratio I'm meaning "most people who have MVP status mention the fact". People don't tend to write what degrees they have, or their professional organisation status, and although many people mention their Microsoft certifications, the proportion of Microsoft certified people that do isn't nearly as high as the number of MVPs that have "MVP" written after their name. So clearly it's something that people ought to be proud of.

But as Dave (and Darren) clearly state (and I agree), it shouldn't be something that people pursue. It's not an achievement, it's an award. I like Kate Winslet's line in "Extras", when she says "If you do a film about the Holocaust, you're guaranteed an Oscar. That's why I'm doing it - Schindler's bloody List..." Sometimes I think people try to do things that make them get noticed for MVP status.

MVP status isn't like that, or at least shouldn't be. When I look at the MVPs I know, they're largely really helpful people, and are genuinely nice. I think if you're a scumbag, you're not actually that likely to get one. Presumably the fact that Microsoft have to know who you are, and ask your peers a bunch of questions too... well, this should filter out people who don't have the right personality.

I don't know if I'm going to get MVP status one day or not. There's also a part of me that worries that if I do, I might not live up to the standard of MVPs. These guys tend to know a lot, and they're almost always people that are online ALL the time. I like to be helpful, and will always do what I can to help colleagues, peers, whoever with their questions -but I don't spend hours each night looking for questions to answer on newsgroups. My blog isn't even that much of a 'resource', despite what I tell the people in my usergroup.

So what do I think of the MVP program? Well, I think it's good. Really good. I think it's a great way of recognising people who are _valued_ by Microsoft. I love the stories of people like Dave Lemphers, Angus Logan and Rocky Heckman, who were MVPs that got hired by Microsoft. That's a great endorsement of the MVP program, the fact that Microsoft likes these guys enough to actually hire them!

More on the Val() function

Following up on my last post... I know you could easily put together a CLR function that uses regular expressions to pull out the numbers, and this may well be faster. But it's a nice exercise to do it in T-SQL. :)

Access Val() function

Steve Koop gave a great presentation at the user-group yesterday about upsizing from Access to SQL. One of the things he mentioned was that there is no equivalent for the Val() function in SQL. To fill in the non-Access-savvy, VAL('abad2j3lk2345') = 232345. It takes any numbers in a string, and converts them into an integer.

Here's my equivalent for SQL2005. Let's start by using our old favourite, the auxiliary table of numbers. I'll assume that we're doing defining @str as a varchar(1000) or nvarchar(1000). If you prefer varchar to nvarchar, then just change the strings accordingly.

So, with the auxiliary table of numbers (which goes from 1 to 1000), we can grab each character.

SELECT num, SUBSTRING(@str,num,1) AS ch
FROM nums
WHERE num <= LEN(@str)

Great. So now let's filter this to only pick up the ones that are numbers.


Let's add a rownum field to the results, but reversed (you'll see why in a second).

SELECT num, SUBSTRING(@str,num,1) AS ch, ROW_NUMBER() OVER (ORDER BY num DESC) as rn
FROM nums
WHERE num <= LEN(@str)

But actually want I want is 10^rn, so let's do that instead. And while we're at it, let's cast that 'ch' field to an integer.

SELECT num, CAST(SUBSTRING(@str,num,1) AS INT) AS ch, POWER(10,ROW_NUMBER() OVER (ORDER BY num DESC)-1) as pwr
FROM nums
WHERE num <= LEN(@str)

You can see where I'm going now... let's multiply 'ch' and 'pwr', and sum them. We need to do this using a derived table, because you can't use a ranking function inside an aggregate.

SELECT SUM(ch * pwr)
FROM nums
WHERE num <= LEN(@str)
) c

So now, throw this into a user-defined function, and you have a VAL() equivalent.

11 September 2006

Using row_number() to remove duplicates

For those of you who are coming to Wagga for the SQL Code Camp (less than four weeks away), you'll hear this tip then. But for the rest of you, here's one of the great uses for row_number() in SQL2005.

Suppose you have a table of data, which includes some duplicates. It happened recently for a guy who posted to the SQLDownUnder mailing list. You want to get rid of duplicates, and keep only the first row for each subset of fields. For example, in the mailing list question, the example was that he wanted to filter to a single field, which I will call idfield, which contained duplicates. It's worth noting here that there is no primary key on the table. If there were, life would be much easier.

One option (without row_number()) is to use min() or max() for each field. Something like this:

select idfield, min(field1), max(field2)
from dbo.sometable
group by idfield

But some types, such as guids, cannot be used with min() and max(). So for that, let's try:

select t1.idfield, (select top 1 t2.field1 from dbo.sometable t2 where t2.idfield = t1.idfield), max(t1.field2)
from dbo.sometable t1
group by t1.idfield

This will do the trick, but it makes life tough for checking that you get fields from the same row. After all, max(field1) and max(field2) might be from different rows. So you can use top with order by to get the right row.

select t1.idfield, (select top 1 t2.field1 from dbo.sometable t2 where t2.idfield = t1.idfield order by field1, field2, field3, field4), (select top 1 t2.field2 from dbo.sometable t2 where t2.idfield = t1.idfield order by field1, field2, field3, field4)
from dbo.sometable t1
group by t1.idfield

And you can see, we're getting pretty ugly. So let's try with row_number(). If we partition over the field that we want to become unique, then our row_number() field starts again from 1 each time it changes. This is ideal, because if we filter to rows which have row_number() as 1, we get exactly what we want!

select * from
(select *, row_number() over (partition by idfield order by idfield, field1, field2) as rn
from dbo.sometable) t
where t.rn = 1

Lovely. Of course, you wouldn't use "select *", but you get the drift. :)


A while back, Jay Furr asked me what my leitmotif was. Now I find myself talking to Lemphers about what his should be.

For those of you who haven't ever come across the word, it refers to that piece of music which identifies you. Like in Peter and the Wolf, how whenever it mentions the duck, it plays a certain piece of music. But actually more like boxers, who have a particular track played when they walk in.

I still don't know what mine should be. But Lemphers wants to have "You can't touch this". I'm thinking that every time he walks into the building, they should play it through some loud speakers. Then everyone will know that he has arrived.

Developing presenters

So I'm talking to Dave Lemphers (of "Time spent here you will never get back" fame) on IM, and one of the things we occasionally talk about is how to develop presenters, and I (bizarrely) suggested having "presentation awards". The idea would be to have our own version of the Perrier awards as a way of encouraging and developing presenters (at user-groups, in podcasts, etc).

Of course, it raises the question of why to present? I guess it's similar to the question of why to blog?

On a personal level, there are a few obvious ones.

  • Shows other people that you know your stuff
  • Develops your status in the community
  • Deals with that fear of public-speaking
  • Increases your consulting price
  • Stops you from having to apply for work, because Readify might approach you
Naturally, your employer will be keen for all of the above (especially if they're Readify), and therefore will encourage you to present as well. But for some reason, the number of people who actually present is quite small.

So that's where some annual awards come in.

TechEd in Europe have Speaker Idol this year. This is a great idea, and perhaps we'll have something like that in Australia next year. But what about the user-groups? How can we get more people speaking?

As someone who runs a smaller-city user-group, I'd like to have a fund to bring people across from interstate more often, or to send the people in my group to other states. But what else can I do? Please post ideas...

08 September 2006

It's "Go the way you want to" week

First Steve Irwin, now Peter Brock. Who next, and what will they be doing?

07 September 2006

Proof I was there! has photos from TechEd. In the 4th one (attendees at the opening session), you can see me! I'm the person 3rd closest to the camera, sitting next to Geoff Orr, who's next to Geoff Appleby.

HandsOn Labs manuals from TechEd Sydney

I wasn't sure if these were going to become available, but it seems they have! for all the links. The DB ones are about databases, and IW are about Office and Sharepoint (IW = Information Worker). Those are the two that I proctored for this year.


@@datefirst tells you what SQL says the first day of the week is (see the linked MSDN page for more). 1=Monday, 7=Sunday. The default for US English is 7. I guess the people who decide when movies come out have it set to 4 or 5.

But, should you let the start of the week be determined by @@datefirst, so that if policy on the Sunday/Monday argument changes you can just alter @@datefirst and let it be done?

Or should you make your code enforce the start of the week as per the policy, regardless of what @@datefirst is set to, with code such as:

declare @df_orig int
select @df_orig = @@datefirst --This is so we can reset it at the end
declare @df int
set @df = 1
while (@df <= 7)
set datefirst @df
@@datefirst as df,
datepart(dw,'20060907') as dw,
(@@datefirst + datepart(dw,'20060907')) % 7 as fixed
set @df = @df + 1
set datefirst @df_orig --Resetting it

So, (@@datefirst + datepart(dw,'20060907')) % 7 will always give 5.

If I want to adjust a date so that I count the number of weeks based on a Thursday start, I can do this with:

datediff(week, '19900101',dateadd(day, @@datefirst - 4, '20060907'))
(where '19900101' is an arbitrary date - if you want to start counting at one somewhere else, then be my guest. The day of the week of this date is not important - it just marks the week in which our 'weeknumber' will be zero)

Why is this useful?

For example - my typical week starts on Sunday. I get frustrated by calendars that start on Mondays, it always throws out what day I think things are. If only I could change the calendars that my kids' school sends us...

But pay-wise, the fortnight starts on a Monday. So I have a sample fortnight start in the system, and I use datediff(day,@fortnightstart,@d)/14 to determine the fortnight that something fits into.

For people paid by the month, the month actually starts on the 25th of each month. So for that, I subtract the offset and strip the day off.

So for any code that I write, I want to know what fixes the start of the week/month. If it's a company-wide policy, then @@datefirst could make sense (and it makes calculations easier). If it's fixed by something else, then it's worth making sure that you have this defined somewhere, and use that. Like in a table of system-wide config values or something. Grab @fortnightstart from there before you need it, or @paymonthoffset, or whatever.

You can also find this at:

01 September 2006

Msgr toast you don't want to see

You don't ever want to see these messages in short succession:

Dave has sent you a message: brb, toilet
Dave has just signed out.
Dave has just signed in from a mobile device.

(apologies to the Daves I know - I'm sure this wouldn't be one of you)

31 August 2006


Michael posted a comment on my post about the ACS membership. He referred to Scott Hanselman's post about how useless that kind of thing is. I figure I should make a couple of things clear.

I certainly don't chase having letters after my name. If I did, I'd be joining every professional society I could. I don't ever write my name with the full set of letters at the end. It's not even on my business cards. I'm happy to refer people to my MCP Transcript, and I wish that my uni transcript was available online (it would save me feeling like I needed have a copy available).

But having said that, I do think that people need to find ways of differentiating themselves from the crowd. For Scott, I'm sure he could call himself all kinds of things to let people know that he knows his stuff. For people who are MS-MVPs, they tend to put that after their name on newsgroups, etc. It gives them a bit of credibility perhaps.

Am I proud to have uni degrees, MS Certs, and ACS membership? Sure. Do I want to flaunt them? Nah, not really. They're useful for potential employers or clients, but that's about it. If I had a PhD, I wouldn't call myself "Dr" much - I don't see the point. But if I were a pastor in my church, I'd happily call myself "Pr Rob", because that helps people understand that they are welcome to talk to me about stuff outside the standard IT stuff that people ask me. Adam Cogan says he'd like to be "Mountaineer Adam". I assume he's not serious, but it's how he sees himself. I'm all for that.

If you see your degree as defining who you are, then put your degree after your name. If you see your MS Certs as defining you, then put them. If there's something else that you think defines you better, then put that too.

But you can just call me Rob. It means 'to steal'.

28 August 2006

Putting the user back into software

TechEd was last week - but you knew that, right? The 'theme' was about the user. Tech.You was the logo. I got a shirt with 'Tech.Rob' on the sleeve. My name card said 'Tech.Rob' too. The keynote speaker was an anthropologist called Anne Kirah. She talked about the importance of having software that makes a difference to people's lives. Ron Jacobs delivered one of the first talks of the conference, and he also talked about bridging the gap between the computer and the person through user-centric applications.

On Sunday, I got asked to speak at church on short notice. I talked about how I'd just spent the week at TechEd, how Microsoft (regardless of how it seems) is trying to make software that makes a difference in people's lives (and not just people who want to edit spreadsheets), and how there's a similarity between that and what the church does. Most people look at the church as being very good at 'doing church', and meeting the needs of people who are 'church people'. But largely, they see the church as being out-of-touch with what people want. The thing is that God (like the powers that be at Microsoft perhaps?) wants to actually make a difference in people's lives.

Unfortunately, most people see the church when they look for God, and non-user-friendly applications when they look for Microsoft.

Rob Farley, SMACS

No, that's not a verb. Just more letters after my name.

I finally let myself be persuaded to join the ACS. On joining, I noticed that I ought to qualify for Senior Membership, so after a brief meeting in Sydney, now I can use SMACS after my name. I figure that the 'S' helps differentiate it from all the MS Certs I have.

11 August 2006

Premier League Tipping

Come on Frank, you know you want to... for score-tipping. for fantasy team.

If you want to be included in mini-leagues, let me know and I'll give you codes to join. :)

10 August 2006

Don't want your mobile to connect to GPRS all the time?

I've found this seems to be a common issue...

When someone's on Windows Mobile (either 2003 or 5.0), they're happily disconnected, but then they open something that wants an internet connection. Suddenly they see a "connecting to GPRS" box, and they freak out because they don't want to pay the GPRS prices for downloads.

Here's how to avoid it.

Go into Settings. Connections tab, Connections icon (use the links for images - apologies to the people who are hosting them!). Then go to the Advanced tab, where there are three buttons. Pick "Select Networks". Then change the "Programs that automatically connect..." boxes to something other than GPRS.

You can still connect to GPRS by going into the Wireless Manager and turning it on. But now your phone won't use GPRS unless you specifically tell it to. Which should keep your mind at ease.

Tag-team user group meeting

Today we had a user group meeting which consisted of six speakers, all giving 5-10 minutes on some SQL-related topic. Plus I gave a few small tips while people were swapping video cables and things like that.

It worked really well! Numbers were down, but I think everyone that came had a really fun time. The speakers were... Keith Zerna, Alex Sims, Roger Noble, Peter Kennedy, Dave Gardiner and Martin Cairney. Roger took the giveaway for his demonstration of SQL Prompt.

Some of the talks could easily have become full-length talks (some nearly did!), which gives me a lot of hope for 1/ using this format again, and 2/ finding speakers when I'm short of ideas.

09 August 2006


Mitch has persuaded me to use feedburner for my RSS feed. So feel free to change your subscription to if you want. The old one will keep working of course.

07 August 2006

SQL Code Camp

October 7 and 8 this year places me in Wagga Wagga for the SQL Code Camp. You'll notice my name in the speaker list. I'm going to talk about row_number(), and other uses of the windowing features. It's called windowing and ranking functions, but I've had a couple of people ask me what a windowing function is. No... there's windowing, and there's ranking functions. row_number() is a ranking function, which uses the windowing feature of the OVER clause.

So anyway, here's my abstract:

SQL2005 introduces the OVER clause to T-SQL, and with it, ranking functions and windowing. Ranking functions, particularly the row_number() function, give database developers a lot more flexibility to solve many problems. And the windowing features of the OVER clause not only allow new solutions to old problems, but can allow a much higher level of query-optimisation than before. In this session, some of the uses of this new functionality will be explored - demonstrating some of the ways in which problems can be solved more easily and efficiently.

If you're interested in this type of thing, grab me on MSN Msgr and ask me some more... or else come to Wagga!

04 August 2006

More on the reading and listening thing

Reflecting on the reading and listening rant of my last post, I've decided that I need to frequent my local library more often. And I also need to work at getting a library system worked out for the user-group I run.

The thing with libraries is that you can't borrow books forever. So you tend to make the time to read them before you have to take them back. Let's say you borrow a book for a month. The first three weeks, it's sitting somewhere in the house, waiting for you to read it. After about three weeks, you notice the book, and you think "Ooh, that book hasn't moved. I should check when it's due back." Turns out it's due in a week's time, and you think "Hmm... that's about 150 pages a day I have to get through if I'm going to read it. I should make a start..." So you read a few pages, and you realise the book is definitely worth reading, and you somehow find an hour or two a day to get it done.

It's a deadline thing. Without deadlines, procrastination can win out. Actually, procrastination isn't the right word. It's more than without deadlines, things can get deprioritised - even if they're quite important. Covey would argue that this is because people live in the "Urgent" quadrants rather than the "Important but not urgent" quadrant. I'm not so big on Covey, but I understand the principle. As I run out of time to read a book, I will probably get to it.

Somehow, the important things get done when urgency increases. If you were told you had three weeks to live, you'd suddenly get around to a heap of things you considered important.

On not reading or listening

Well, not so much about not reading or listening, but not doing enough of either. I do read, and I do listen. But I want to do so much more than the day allows.

During my commute, I listen to podcasts. But my commute is really short, and there is so much stuff to listen to. Over a year ago I got Egress for my XDA IIs. So whenever I'm connected, it's downloading podcasts from the various things I'm subscribed to. I can't listen to podcasts while I'm working - that has to be music, or perhaps the radio (London's Capital breakfast show is great - I'm even coming around to the fact that the host isn't Chris Tarrant any more, like it was when I was a kid). But I can't listen to ARCast or the ASP.Net Podcast (not to mention SQLDownUnder, DNR, Hanselminutes, etc) while I'm working. Or non-technical ones like the BBC's Rumour Mill, The Premiership Podcast or Max Lucado's Upwords. Already I've run out of dead time. And I've just noticed that the Edinburgh Fringe podcast is out again.

The best time to listen to podcasts has to be when driving alone. You know, those times when you'd otherwise be listening to the radio. But if you're driving with the family - they don't want to listen to Ron Jacobs, no matter how interesting the topic (no offence, Ron - my wife just isn't into Software Architecture). And she's not interested in football enough to listen to the Rumour Mill.

And reading... I'm jealous of Mitch Wheat, who tells me he reads 2 large books a week. They must both be good books! ;) Yeah, ok... they're not the same 2 books each week, but even so. I don't know when I'd find 2-3 extra hours a day for reading. Time reading is time away from the family, and my computer takes enough of that time as it is.

Don't get me wrong - I do read books... both technical and non-technical. But I find myself constantly lamenting the lack of time for both reading and listening.

Mind you, I've only got to the stage where I'm blogging about it because this morning I noticed the Fringe podcast and a post by Mitch about reading. So I guess it's on my mind. And getting a job that's further away isn't the answer. The answer is to warp space and time, to insert a few extra hours into each day.

03 August 2006

Proctoring at TechEd

I'm helping out with the Hands On Labs at TechEd this year. Should be fun. It makes TechEd cheaper for my employer (not that they particularly care), but that's not really important to me. What is important to me is that it's a chance to be able to help people learn stuff that will be important. It's why I'm an MCT, and it's why I'm involved in the user-groups.

Speaking of user-groups, if you're in my SQL User Group, and you haven't volunteered to do a 5-minute slot next Thursday yet, then drop me a line.

PS: If you're going to TechEd, drop by the Hands On Labs on Wed 1-4, Thu 8:30-11:30 or Friday 12-3 to say hi.

01 August 2006

Kelvin Wilson appears to be offline.

My time away was good. I had lots of fun at Redmond. It was really great to work with such talents as Tobias, Brian and Bill. The weather was great too, and having my family there made everything good. We sat by the pool in the evenings, or went out somewhere.

So after 2 weeks there, we went to London to see my family. My grandmother has heart surgery this week, so it was very good timing. The weather was hot, and things were good...

...except that on Monday morning, I had a phone-call from Australia to tell me that my friend Kelvin Wilson had died. I would talk to Kelvin almost on a daily basis. We would talk about SQL, about theology, sci-fi, comedy, rugby. It's very sad that he has died. There is a blog that can take comments about him - - you will be missed. His funeral is tomorrow, and I will be there. It will be the first funeral I have been at since Roslyn's dad died, which in turn was the first funeral I was at since my own dad died over 20 years ago. I don't do funerals in general. For Kelvin, I will make an exception.

17 July 2006

Seattle, and driving to Cicely, Alaska

I haven't blogged for weeks. I haven't recorded a podcast for Aussenal 2 months. The World Cup distracted me on the football side, and this trip to Seattle has kept me really busy too. I'm in Seattle at the moment. It's Sunday evening (nearly 7:30pm), but back in Australia it's Monday lunchtime. I know I'd rather have Sunday than Monday... ;)

So I'm in Seattle, helping put simluation content together for 70-431. It's a way that Microsoft can test people's knowledge without using multiple-choice questions. It's really good too. Met some more great guys, and enjoying the summer weather. I've brought the family with me, so when I get back to the apartment in the evenings I can spend time with them. Today we had a relaxed morning, swum, and then went to Downtown Redmond and found a Fred Meyer store - Roslyn liked that. On the way back, the clear day (over 30C, and not a cloud anywhere) meant that Mt Ranier was clearly visible as we came down the 520.

Yesterday (Saturday) was my first full day off. We went to the Boeing factory near Everett, and then came back, and headed into the Cascades. We saw the Snoqualmie Falls, which were really impressive. I've been to Niagara, and of course it's nothing like that - but these are still really cool. From there, we drove down to North Bend and met the I-90 Freeway. Just before the turnoff, Roslyn saw a Nike Factory Outlet store, which turned out to be part of a much larger factory outlet complex. These are great - you're in the middle of a mountain range - huge great slab of rock in front of you as you walk out of the Nike or Adidas shops, and they're proper factory outlet stores, much better than the ones near us in Adelaide.

So then we continued down the I-90 to a town called Roslyn, which is actually Cicely, Alaska (from Northern Exposure). My Roslyn liked the show, and got a kick out of the fact that the town shared the name with her. The town seems really quaint, but it looks like everyone's leaving it. Lots of businesses for sale, although The Brick pub seemed to have a remarkably good trade going on.

Definitely worth the drive - and it's definitely nice to be in summertime for a few weeks.

30 June 2006

TechEd Flair

Last year, I put the Hoff into a TechEd Flair. This year, focussing on the Deep Dive workshops seems appropriate.

IE7Beta3 - uninstalling Beta 2

This happened to a friend of mine. Oh, alright Mitch, it was me.

IE7 Beta 3 has been released. I've been using Beta 2 for a while, and figured that this might answer a few questions.

So I downloaded the IE7 Beta 3 install, and ran it. Turns out I need to uninstall Beta 2, from Add/Remove Programs. But it's not there. Hmm... that's right... I ran some HotFix install-code remover thing a while back when I wanted to clear some space.

I borrowed someone's $NtUninstallie7b2pmx$ directory, and ran spuninst.exe, like you do. ;) Turns out that it thinks that I'm not the same user that installed it. Yeah, that's a point.

So I looked through spuninst.inf, and found that it checks the registry at HKCU\SOFTWARE\Microsoft\Internet Explorer for an entry called 'InstalledByUser', with value 0x10001. I put that in, and now spuninst.exe works. Now I'm going to reboot, and IE7Beta3 should go in just fine.

26 June 2006

Innovative Adelaide

Thanks to Microsoft, Kaz, and possibly someone else I can't think of, the Innovation Day is coming to Adelaide. Register at - and soon. It's on Thursday July 13th, which is the day that the SQL Server User Group is normally on.

So instead, the User Group will be on Friday 14th. Usual time and place. Dave Glover speaking on Visual Studio Team Edition for Database Professionals. Because I'm away, Keith Zerna will be your host.

Another Seattle trip

Obviously I didn't offend enough people last time - they've invited me back again. This time to help with content for 70-431. Simulations, etc. Should be good. 2 whole weeks this time, so I'm finding the extra to take the family as well.

A couple of articles

I've tried my hand to writing articles. I've had a couple appear now - one at about using SSMS with SQL2000 servers - and one on about a fix() function in T-SQL. More to come I hope, time-permitting. I want to convert my recent 'execute as' talk into an article, and also one about people's ages.

14 June 2006

10 Simple Rules...

Mitch Wheat has thrown together 10 rules for reporting. Nothing really new here, but it's very nice to see them listed. I particularly like the idea of having an ID code for each report - I would've had that as a rule on its own!

13 June 2006

Australia v England

No, they're not playing each other - at least not in football but I wanted to quickly write something about the two teams.

England played Paraguay on Saturday, and looked remarkably ordinary. Many times teams play against weaker opposition, and really don't perform. I consider it like my youngest son Joel, who draws good pictures at home, but at school tends to draw stuff that is much lower quality. You put him around kids that aren't as good, and he drops off too. I think this is what England did against Paraguay. They started well, got an early goal, and then drifted off. Paraguay never really looked like scoring, and I think the highlight of the match was when Paul Robinson (the England goalie) kicked the ball so high that it hit the video screen that was suspended over the pitch.

Yesterday, Australia played Japan. It was a must-win match for both teams, as the countries likely to progress from the group are Brazil and Croatia. Australia flooded the midfield, and had most of the possession. Japan looked chances in the counter-attack. But all too often, you heard "And Kewell fails to find Viduka again" Was Kewell just having a boy-look? Was Viduka down at the pie-shop? It was good that Australia managed to get a few goals in the end, but I think they need to sort out both their attack and defence.

Both sides picked up three valuable points in matches that should've been easier work than they actually were. It will be interesting to see what happens from here.

VS-DB downloaded

Well, I've downloaded the CTP for Visual Studio Team Edition for Database Professionals. Now I need a few minutes in my day to start playing with it...

Scoble leaving Microsoft

Wow, Robert Scoble is leaving Microsoft. I suppose it was always going to happen at some point - his blogging was always very independent, and frequently criticised Microsoft as well as praised it.
Will the world be changed by him leaving? No, I doubt it. Will he keep blogging? I'm sure he will.

Does this make Frank Microsoft's #1 blogger now?

07 June 2006

I'm the speaker at the Adelaide SQL UG tomorrow

Well, I'm the speaker at the user group tomorrow. I hope people will enjoy my presentation, I'm going to happily go off on tangents, and stuff like that. The idea is to make people think about some of the stuff they can do with execute as.

02 June 2006

VS-DB is coming

The press-release is here, and the excitement is building. A new version of Visual Studio, designed for DB Professionals. It lets you have a proper Database Development Life Cycle, and all kinds of funky stuff. Finally! Now I want to include a bunch of stuff about it in my presentation next week, but the CTP only comes out on June 11th.

I had a few people point me to Greg Low's post this morning. Thanks guys. :)

25 May 2006

Batfink shirt / cap

I was thinking... Quite a few people only know me through MSN Msgr. And I don't have my own face as my Display Picture, I have Batfink - obviously. So I was thinking that before TechEd (or any other event where people might not know me), I should get myself a shirt with Batfink on it. Or a cap if I can't do that. Good idea? Perhaps my Arsenal shirt will do.

Paul's now MCPD!

I got a text message from Paul this morning. It was about 10am in Sydney. He'd just earned himself MCPD-Windows. Yesterday morning he had never sat a Microsoft exam in his life. Today he's just passed his third and has earned himself MCP, MCTS, MCPD. What a legend!

24 May 2006


Today I sat 70-290. It's a sysadmin exam, but I needed it to complete my MCDBA, and perhaps it's fair enough that there's some . Anyway, today I got my 8th Microsoft certification. Yay for me.

I'm actually more proud of Paul Stovell. He sat his first two ever MS exams today, and is now MCTS-Windows. Tomorrow he's sitting another one, and more next week. Well done Paul.

18 May 2006

Cavemen and interfaces

The other day I downloaded the Cavemen beta (thanks Frank & Andrew) for my PocketPC. The game's really good. The interface suits a tablet-interface really well. Got me thinking a bit about how many applicatons would really be much more suited to using a pen than a mouse. I know that I keep wanting to get a decent image editor for my PocketPC. I like playing around with images, and it would be so much easier to do it with a pen than a mouse, even though the screen-size is obviously so much smaller. When I get a tablet pc, it'll be so much easier. Fathers' Day is coming up soon, right?

Guts ripped out

Today my team lost. We had come so far. Led the game. 15 minutes from the end, we conceded two goals, and that was the end of a dream. Well done guys. We'll be there again, and will win next time.

17 May 2006

World Cup tipping - please join!

I'd like to invite all the readers of my blog to join the mini-leagues I have set up at a couple of World Cup tipping places. One is tipping, the other is fantasy league. Both free to enter, and both are just for bragging rights (although if you win the whole site, you can get some cash).

The tipping is at and the fantasy league is - the code to join my league is 31847-7496.

I know the guy who runs FPLI - he's the guy who gave me his seat at Highbury for the Villa game recently. Great guy.

Not 'free retake', but 'free practice exam'

...with the bonus that if you pass the practice exam, you don't have to do the real thing.

I was talking to a guy at work this morning about the free retake offer from Pearson Vue. I think the best way to think of it is that it gives you a free practice exam. This guy is a sysadmin here day in, day out. So he should know his stuff already. A few skims through the summary pages of a study guide book, and that should be enough preparation for a practice exam. And if he passes it, then great - he doesn't need to do the real one. And if he fails, then he's had the perfect preparation for the real thing.

'Expert' interviewed by BBC

I normally wouldn't post something like this, but it's just a classic piece of journalism.

16 May 2006

MCTS for Al - he just did it

A while back I had a chat with Alastair Waddell. I told him he should take advantage of Pearson Vue's free retake offer to do some of the new certifications. Because he's been using SQL2005 for about a year (and he's a smart guy), he ought to know enough to pass without studying, and if he does somehow fail something, he can retake it for free.

So he took the plunge, and is now MCTS:SQL2005. Well done Al!

I'm telling everyone I think of to take advantage of the retake offer. I figure that if you are already working in the space, you should be able to pass these exams already. So book in and try. And if you fail, use the free retake offer to try again. But here's my tip: While you're in there, make yourself lists of the stuff you feel you need to study. You can't take those lists with you, but after you've left, write those things down and use them to bump your score up a few marks for the second time. But hopefully you won't need the second time, and you can use your list to just brush up your skills.

15 May 2006

MCPD now

I got my results for the exams 547-9 today. I passed all 3. That makes me a Microsoft Certified Professional Developer - Windows Developer. It should be a few times over (Web Developer and Enterprise Applications Developer too), but I didn't sit 528 in beta. So I'll either sit that this week and get it out of the way, or I'll wait for the results in my upgrade exams, which will mean I won't need it. MCDBA next I think.

12 May 2006

Returning the wrong type on purpose

There is a 3rd party application we put scripts into from time to time - it's a pretty good app on the whole, but these scripts have to be VBScript.

Anyway - I pull data out of a database to use in these scripts, and have recently found that I have had to tell my query to return numbers as varchar. The reason? Because when I try to use CLng on the data (which I like to do in non typed languages), it complains that my numbers are bigger than 2 billion. So instead I'm putting more functionality into my query, and doing my subsequent maths there, returning the data as a pre-formatted varchar ready to just get printed out. I feel dirty and have to go home to wash.

New stylus from Kyle Grovers

I dropped into the Battery Bar (no proper website???) this evening in the Adelaide Arcade (that's the one where the fountain is in Rundle Mall). I got a new stylus for my XDA IIs. I'd lost the others.

The guy who served me was Kyle Grovers. We got talking. (I know, you're all thinking "Really Rob? You're normally so shy and retiring...") So anyway - I thought I'd blog about him. Now if he googles himself (is that allowed?), he might find a mention. He was really helpful. Suggested that a piece of sticky tape around a stylus can help stop you losing them... so long as you can do this before you actually lose them of course.

My new stylus has a pen inside it, which makes it even more useful. I would've rather had a multi-pack, but this will do.

Arsenal in Paris, Rob at the Rosemont

I don't get to go to Paris. But I do get to go to the Rosemont Hotel (on Hindley St) to watch them. Kick-off is at 4:15am, so I'm going to be a little bleary next Thursday. If you're not in Adelaide, then find out where your local Arsenal supporters are going to be.

SQL Group and Architecture Group

Yesterday was a big day for user-groups in Adelaide.

At lunchtime, our SQL Server group met - Nick Ward (SQL Product Specialist with Microsoft) spoke on Service Broker. Over 40 people again. Fantastic food, fantastic talk, lots of great feedback in the eval forms. Personally, I love the idea of using Service Broker to create asynchronous triggers. That's nice. :) You can get Nick's notes from

In the evening, a new Architecture group formed. I couldn't go, because Roslyn's not 100% well this week (nothing serious thank goodness). But Derek Munneke went, and tells me they had 15 people rock up. It's going to be a regular thing, and it's now part of IASA. Was talking to Clarke Scott today, and he's really excited about the whole thing too. Perhaps we can show Melbourne up a bit! (Which is exactly what Adelaide should be doing...)

10 May 2006

Quick security update tomorrow

Tomorrow (Thursday 11th for those of you reading this later), we have the Adelaide SQL UG meeting as usual. Nick Ward speaking on Service Broker - should be good. Good crowd coming too - about 40 people again (that reminds me, I need to look through the lists to see if it's the same 40 each time).

Here's the new thing though - just before Nick gets up to speak, we're going to have a quick update from Carl Jongsma, a local security expert. He has stuff to tell us about some recent patches. More here once I've heard what he has to say.

08 May 2006

Adam Cogan in Adelaide

The rumours are true. Adam Cogan is coming to Adelaide at the end of May. And I don't mean just roughly at the end of May, I mean the 31st. All afternoon. 12-4pm. That's a Wednesday too, so it'll be a nice mid-point to the week.

He's coming to do an event on VSTS. VSTS is so cool, and remarkably relevant to SQL users too.
Adam's going to be showing us about how it can help manage buglists and work items, things like that. Now, I know that SQL Developers always write bug-free code, but you can't deny there are times when you want to get someone else in your team to do something. So come along and find out how the Team bit of VSTS works.

Nick Ward's coming

This Thursday, Nick Ward from Microsoft will be at the Adelaide SQL group to speak about Service Broker. This is one of those meetings you will probably think "Oh, we don't do Service Broker, I won't bother going...", but you'd be wrong to do that! So wrong!

Fact is, Service Broker is one of those things that you have probably underestimated. It is a very powerful tool. So come along and find out why.

06 May 2006

So sore...

My wisdom teeth came out on Thursday. Apparently Day 3 is the worst for pain and swelling, and then after that, you swap from cold packs to hot ones, and start recovering. I don't know whether Day 3 is Saturday or Sunday, I guess it depends on whether you start counting from 0 or 1. I guess VB fans would say today is Day 3. I'd say it's tomorrow. Either way, I'll start using hot packs tomorrow, and hope that the pain reduces.

Pain killers are my friend... And I'm thinking I shouldn't've booked in to do exams on Tuesday and Wednesday (ones I didn't get to do in beta).

01 May 2006

MCT now

I've applied to become MCT, and now have 3 extra letters to go with the pile I already had. That makes it MCP, MCSD, MCAD, MCSD.Net, MCTS, MCITP, MCT. MCPD will come soon (with beta exam results hopefully), and I might do MCDBA with some of the vouchers, even though it's been superseded by MCITP.

MCLC is an interesting one. That's Learning Consultant. For people who train and also consult. So I figure that's something worth applying for some time. It's not available in Australia yet though. Plus, you have to be an MCT 'in good standing', not just a newbie MCT.

20 April 2006

SP1 out is the place to go...

18 April 2006

SQL2005 SP1

Seems SQL2005 SP1 (RTM) will become available on Wednesday April 19th. But that's US time. Keep your eye on - it's bound to get mentioned there.

13 April 2006

Geoff Orr - what a legend!

Geoff Orr spoke at the Adelaide SQL Server User Group today. He did a great job too! Made a talk about backups really quite interesting.

Lots of people have asked about the scripts he used in the talk, so I've uploaded them to for your downloading pleasure. Good luck with your presentation at Code Camp, Geoff. :)

12 April 2006

My time away

I've had a bunch of people ask me how Seattle was. Apparently Seattle is famous for its rain. I know England is too. But I didn't get rained on the whole time I was away.

Seattle was pretty cool, but I'm convinced I went the wrong way around the world. Pacific Time was only 5.5 hours different to Adelaide (before Daylight Savings changed, and with a day thrown in there for fun). But in the evenings, it would feel like the afternoon. So midnight would come and go, and my body would be thinking it wasn't supposed to be up yet. Then morning would come, and I'd be like a teenager and want to sleep until noon.

So I didn't see fish fly, because I wasn't awake at the right times. But I did do other tourist stuff there, until my meetings started - forcing me to get up early. But they were good, and I got to meet a bunch of cool people (Scott, Bryan, Erick, Julian, Alberto, Lars and Fannie plus Microsoft people Greg, Jennifer, Julie and Glennie).

So then coming back to Adelaide, I had a stopover in the UK for a week. Got to catch up with family, friends and Arsenal. :) The score was 5-0, which made it a very nice match to watch. It was great to be at Highbury for one of the last matches there. Many thanks to Jeremy for the opportunity.

London is continuing to improve, I think. They're doing nice things down on the river at Wapping. PaterNoster Square near St Paul's is quite nice too, although not as nice as many of the other squares, like Trafalgar or Leicester.

Back in Adelaide - not going to Wagga though

I'm back in Adelaide again. I actually arrived back on Monday, but spent half the day asleep. Then yesterday I was trying to catch up with everything (along with aching from jet-lag). Now today, I feel like things are getting back to normal. Just in time for AdSSUG tomorrow (Geoff Orr's speaking - it'll be great), and then Easter.

I won't be at ADNUG tonight - school concert on, featuring Samuel on saxophone. And I won't be at CodeCampOz next weekend either. Having been away for a while, family time is coming first. Shame really, but that's fine - there will be other events.

26 March 2006

In Seattle!

Well, I've made it here. It was a long flight from Adelaide, via Sydney and San Francisco. I'm about to turn in now because I haven't slept for quite a while.

It's been good to meet Itzik and Lilach Ben-Gan - they're great. We'll need to get them out to Adelaide some time.

23 March 2006

Got my phone back :)

Thanks to Moneeta at Optus, I now have my phone back. My charger's at home though, so I can't charge it up to re-install it until I get home tonight. But it's very nice that I get to take it away with me. :)

22 March 2006

Keeping my teeth until Star Wars Day

With my trip to Seattle now confirmed, I've had to delay my wisdom teeth extraction until Star Wars Day, at Tooth Hurty.

21 March 2006

It's all arranged - mostly

My flights are booked. I'm leaving for Seattle on Saturday. Leaving Seattle late on Thursday night (well after the meeting) to come home via London, with plenty of time to get to the Arsenal game on April 1st. Now I just need to arrange tickets. I figure my podcast should help, plus the people I know.

All very exciting. God is definitely on my side in the way that this has been able to be arranged. And thanks to Microsoft for letting me be part of the beta exam process!

Very sad for the people who have missed out. You know who you are.

And I need to get my phone back before the weekend!!! Judy (from work) is looking into it for me. Come on Optus!

20 March 2006

Bitwise reversing

The geek in me is clearly alive and strong. I found this post on reversing a string using bitwise XOR quite appealing.

Although really, it's not that different to storing a character and swapping them over (plus swapping the characters that way would be more 'obvious', which I think is always a feature of good code). The thing that makes a recursive function slow here is that you're building a new string. This function (and one where you swap characters) simply changes the string in-place. Plus it does it from both ends at once.

Personally I'd rather have the variables named better (instead of 'i' and 'len', why not use firstHalfCharPos and secondHalfCharPos, or something tediously long but descriptive like that?), but I do admire the 'fun' of the bitwise XOR, and it's a good way of demonstrating the principle of XOR.

No word yet

Still haven't heard about the trip to Seattle. The email said we'd hear by the 20th. I figure that means tomorrow, because it'll be the 20th in Seattle by then. I tried phoning on Friday and Saturday to find out if the offer really was open to non-US residents, but I only got voice-mail and haven't heard back yet.

Glasses fixed

Well, in the end I fixed my glasses myself. I felt like I didn't have the right tools for the job, but I got it done, and I'm not sure why L&P couldn't do it. Anyway - I'm wearing my ordinary glasses again now, with both arms attached. :)

17 March 2006

A few SQL Rules

I just came across Jeff Smith's post (thanks to Darren). I like Jeff's advice. I'm pleased to say that I do all this - despite the odd bit of flak I might take over my use of derived tables. I think derived tables are great.

The very fact that Jeff has made a post like this tells me there are a bunch of people out there who don't do these things, and that makes me really sad. It really frustrates me when people do nasty nasty stuff with their queries, and I often feel like people approach writing a query like they would approach an API. But anyway, I like Jeff's rules.

Here's a thing I quite like these days...

'colname1' = whatever1,
'colname2' = whatever2,

as opposed to:

whatever1 colname1,
whatever2 colname2,

Giving my columns names this way (the first way) means that all my column names are lined up nicely, and even all the definitions are lined up nicely, assuming I hit tab before the equals sign. It means that when I come to glancing at the query, I can see exactly what the result columns are - and this really helps in my derived tables too!

And now for some name-dropping

Well, if the trip to Seattle goes ahead, then Robert Scoble will arrange a geek dinner! We exchanged a few emails today - he told me about a Daniel's Broiler in downtown Seattle, and stuff like that.

Unfortunately I won't be able to catch up with Ron Jacobs while I'm over there. I listen to his ARCast podcast regularly, but he'll be in the UK while I'm in Seattle. And even if I get to come home via London, I have more important people to catch up with than Ron there. Family, not just Arsenal players.

16 March 2006

Please don't let it be true

Chris Hewitt has just told me that he received a similar invite for a meeting to discuss one of the other beta exams, and that it said something about "US only". But this can't be true, because there were heaps of addresses in the rest of the 'to' list that were in .uk, .pl, .it, .hu, .ru, etc... It can't just be for Americans.


Arsenal game

Oh, I shouldn't do this... The idea (of course, it hasn't all been confirmed yet, but anyway...) of going to Seattle in just over a week's time has got me thinking. It might be just as easy (and just as cheap) to fly back home via London, taking a stopover there to break up the trip, see my grandparents, and perhaps drop in to Highbury to see Arsenal play Aston Villa.

I know the guy who runs the website, and of course I do a podcast about the club (although I'm off the air while Optus fix my phone), so really I should be able to get pressbox tickets, and interview a few players, etc...

I'm getting ahead of myself of course, but it's nice to dream. :)

What to do in Seattle...

So... I'm going to be in Seattle for a meeting March 28-30. I'm going to need suggestions on what to do. Obviously dropping in on Bill if he has the time... But what else? Surely people have a bunch of suggestions. I've never been there before. Presumably a trip up Space Needle, but how good could the view be? Comments & suggestions would be welcomed. :)

Invited to Redmond

I just got an email from the Assessment & Certification Exams team at Microsoft, inviting me to a three day meeting at Redmond. :) They referred to me as a 'high performing beta examinee' - and when they use phrasing like that, who could say no? (Besides, I've never been to Seattle before)

More on teeth

Well, in a fortnight I'm going to have 3 of my wisdom teeth out. I get to keep the top left one. I shouldn't be nervous, it's a routine thing... intravenous sedation... should be fine. But I'm sure I'll have more grey hair afterwards. *sigh*

15 March 2006

Still blind

I got a phone call last night to say that my glasses couldn't be repaired. I'm not giving in yet though.

Google Talk / GMail Chat

I saw a green dot next to Rowan's name in GMail today, and thought I'd try out the Chat/Talk feature. Works quite nicely, all within the browser, and working well in Firefox too.

The thing that I found was the most 'cute' was that when I put a smiley in, it turned it around and animated it - but not into some yellow thing like the MSN Msgr ones, but one that still looked like it had been typed. And if you did something like :-) or :^), it would leave the nose in there too, in the same way that it was typed. :)

14 March 2006

On teeth

My wife Roslyn has had bad teeth ever since our first child was born. My teeth have never been too bad, although I don't like them. I don't know many people that do like their own teeth, although it's not really a typical conversation piece - "Hi, I'm Rob... do you like your teeth?"

One of the big problems with my teeth is that my lower wisdom teeth grow sideways. I don't know why this is, but I've seen the pictures, and it's definitely true. They grow sideways, towards my other teeth. I discovered this a few years ago, but it was going to be all too complicated to get them removed, and they weren't giving me any grief, so it was all fine. Not the case any more. Now, it seems that on the right, my wisdom tooth has punctured the tooth next to it, and made a hole that the dentist couldn't reach if he tried.

So on Thursday, I have an appointment with an oral surgeon. I think that should be someone who just talks about surgery. I remember having oral exams in French class at high-school, and it certainly didn't involve a reclining chair, weird light and a bloke counting. Anyway - Thursday isn't the big day, it's just a consult.

Peter Ward in Adelaide last week

It was great to have Peter Ward come and speak to the SQL User Group last week. Peter spoke about SMO, and did a great job. I think a lot of people learned a lot of stuff, which is just what we want from these meetings.

You can listen, watch and read to the presentation using the following links:

Audio and screen (49MB)

Audio only (16MB):

Slides, code, etc (much smaller):

They were recorded with Camtasia, which although doesn't give the feedback-ability of LiveMeeting, seems to be very effective at making a nice recording.

We had just over 40 people come along, which is really good.

Next month, Geoff Orr, talking about backups!

Motorbike accident (not me, someone else)

Last Wednesday I witnessed a motorcycle accident. I was heading down Glen Osmond Rd (for those people who only kinda-know Adelaide, that's the road that goes south-east from the city towards the freeway), and just after I pulled away from the lights, a car just a little further up pulled out of a petrol station and hit a motorbike who had accelerated up to 60km/h a lot faster than any of the cars.

So I pulled over. The rider hadn't quite been knocked off his bike. He'd wobbled a lot and got his bike to the curb before basically falling off it to lie down on the footpath. The woman who was driving the car was sitting in her car eating an ice-cream (she was on her way home after working overnight). I went over to him to see how he was. No blood, but he didn't seem to be particularly well-off, so I called 000. Haven't had to do that before. I've called 999 before when we lived in the UK, but I think this was the first time I've had to call 000. Ambulance and Police on their way.

The ambulance arrived, checked the guy out, and he was basically fine. Big bruise coming up on his leg where the car had hit it. Still shocked, naturally. Waited for a while longer for the police to rock up. They couldn't really understand why they'd been called. Didn't breathalise either of them, didn't take any details, asked if the car and bike were driveable, and went on his way to deal with more important stuff I guess.

On Saturday I got a phone-call from the rider. He's fine. His leg was basically saved by the leathers he was wearing, but he still has a massive bruise. Plenty of damage to the bike. But essentially, he was okay. Turns out he's a student a Lutheran seminary. I think God was looking after him that day, because he's really lucky he didn't get knocked off his bike into oncoming traffic.

I got to my exam a little later than I hoped, and felt like I was distracted half the day. I bet I did better in my Wednesday afternoon exam than the morning one.

My busy week last week

It's nice when you have a public holiday at the end of a really busy week. Last week I did 5 beta exams (hopefully I passed at least two of them!), ran the SQL User Group on Thursday lunchtime, featured in the .Net User Group on Wednesday night (although I didn't go - they just talked about me), watched the Arsenal-ReaMadrid game on Thursday morning, had some big meetings on Tuesday (the only day I was at work all day), had Samuel (my 8yo) go on his first 'no parents' camp for a couple of nights, and got to be a witness in a motorcycle accident on Wednesday morning (just before I got to the exam place to sit one of my exams).

I guess it wasn't really all that busy - but all week it felt like I should be doing something else. Study mainly.



I'm a SQL Server MVP

Contact Me

  • MSN Msgr:
  • Yahoo Msgr: robjfarley
  • Skype: rob_farley
  • Email:

Blog Archive