Monthly Archives: June 2012

SQL Server: Linked server select query into a new table

It’s always worth remembering SELECT INTO a new table or a temporary table, here’s and example:

SELECT [COL1], [COL2]
INTO [DB name].[Schema name].[Table name]
FROM [Source DB name].[Source Schema name].[Source Table name]

This will create the new table with the columns matching the name and types of the selected columns.
Alternatively you could select into a temporary table like so:

SELECT [COL1], [COL2]
INTO #temporarytable
FROM [Source DB name].[Source Schema name].[Source Table name]

For performance reasons you may want to copy the contents of a linked server into new or temporary tables in SQL Server, then run complex scripts and SQL against your SQL instance. Here’s an example of how I would do this, I am using OPENQUERY because that takes care of type inconsistencies for me:

SELECT [COL1], [COL2]
INTO [DB name].[Schema name].[Table name]
FROM OPENQUERY([Linked Server], N'SELECT * FROM SourceSchema.SourceTable')

Of course here your linked server could be anything, but I’ve used this for Oracle most recently and it was so much better than trying to export the data from Oracle and import it into SQL Server.

Eleven thousand miles and still loving the Rohloff #cycling

I thought I’d update my mileage spreadsheet, it’s been a while.
Since I bought Thunder second hand in August 2010 he has covered 11,450 miles.
Bluebell has only managed 370 thus far, give her time 🙂
The Rohloff had covered around 20,000 miles when I got it, so it is now up to 31,800 miles.

So, after eleven thousand miles, I thought I’d Q&A myself on the Rohloff…

Q: Was it worth the money?
A: Yes

Q: Do I need to replace it?
A: No

Q: Do I want to replace it?
A: No, a new rear wheel build would be nice, but I’m not complaining.

Q: Has it cost a lot to maintain?
A: No, a few cables here and there and a simple oil change every so often.

Q: Has it been easy to maintain?
A: Yes compared with deraileurs, changing the gear ring cable was fiddly, but once you’ve done one it’s not difficult and oil changes are easy. Changing the sprocket is easier than a cassette change.

Q: Would you go back to a deraileur setup for commuting?
A: No. The only time I’d consider it is for a cheap bike to leave at a train station or public place.

Your current bike is your favourite bike, however good or bad it may be, enjoy the ride.

Bicycle bottle cage DIY #cycling

The problem

Small bottles fall out of bottle cage, like so:

The solution

Make a sleeve to hold it.

What you need:
– 1 litre squash bottle, high juice or similar
– Sharp knife (and protective gear if you aren’t handy)
– Lighter / olympic flame

What you do:
– Cut the top off the bottle with the knife (wearing protective gear if you need to)
– Melt around the top / cut with the flame

Simples:

I like to use small water bottles that can be recycled and replaced at low cost, that way the bottle never gets filthy dirty or too much hassle to clean off the bacteria build up:

In summer I often use high juice bottles instead.
In heavy rain your sleeve will collect water, so you might want to also pierce a few holes in the bottom.

Garden update

Last night I posted a snapshot of the garden on 26th May, well a fair bit has changed since then, I mentioned some of the changes, but I thought some more recent photos would be nice, so here’s another update…

Can you spot the leek seedlings?

Here’s one, the tell-tale folded leaf on the seedling:

The potatoes have exploded, here’s a photo to compare with the last post:

I earthed them up on the weekend:

And even the spares growing in the soil pile have really come on:

The broccoli look happy now I’ve weeded them:

The cat features in the top corner of the photo, she was around my feet for most of the time, sucking up after eating my charger cable!

The runner bean race was won and the strongest looking one did indeed reach the top of the fence first:

Another Damson picture, look carefully and you’ll see a fair few damsons:

I’m looking forward to educating those who never tried a damson 🙂

The raspberry bush is looking plentiful, the children will enjoy these this year:

The strawbs are looking much better this year:


Last year I eat most of them, maybe this year others will too.

Finally, not strictly garden related, but I’m trying bean sprouts (Mung beans). A tablespoon full, warm water and a jam jar:

Placed in a box (padded with news paper so it doesn’t tip up:

Closed up to keep the light out:

This is trial and error, we’ll see how they go.

Cat chewed my bike light charger #cycling

This weekend was a lovely rest and gave me some time to spend on the garden and I didn’t do any cycling at all.
This is very fortunate because yesterday I noticed the cat had chewed through my Air Bike Ever Light SL1 battery charger and the battery no longer charges. This meant I had to do an emergency repair of the cable and I’m now searching out a replacement or alternative lighting solution.

I’ve posted up on the CTC forum hoping to get some advice from the beardies, I’ll keep you posted on what they come up with and what I eventually decide on.

To anybody who reads this: I’d love to know your suggestions too please.