Recent twitter entries...

Update SQL Server and return ID of row updated

Posted by Brad | Posted in SQL Server | Posted on 10-12-2012

So you want to update a single row in your table and then return the row identifier that was affected, here’s one way of going about it. Remember SCOPE_IDENTITY() is about inserting so as we are updating here we need a little something different.

This will update a single record and output the id of the record it updated
 

DECLARE @TmpTable TABLE ( primary_id INT )

UPDATE dbo. table
SET someColumn= ‘Some value’
OUTPUT INSERTED. primary_id INTO @TmpTable
WHERE primary_id = (SELECT MIN( primary_id ) 
FROM dbo. table nolock WHERE someColumn <> ’Some value’ )

SELECT * FROM @TmpTable

Application window freezing in Windows 8

Posted by Brad | Posted in Angry Rants, Windows 8 | Posted on 03-12-2012

So I am an early adopter of windows 8 on both my home computers, the intro price was just too good to miss at £15 each to windows 8 pro including this media centre thing.

My first peeve with windows 8 is that applications have a frozen interface, so far winamp and search engine ranker – you can see from their CPU usage that they are still active and indeed music still pumps out of winamp; but after a couple of hours the labels etc that indicate how many minutes have elapsed or the log of what SER is up to stop moving… and the only way to kick them into action again is to restart the application…

Infuriating…. hopefully win 8 sp1 fixes this.

The only other thing I found I don’t like so far in these few weeks of using windows 8 so far is switching user, this takes surprisingly long for the user select screen to come up.

 

UPDATE 12/12/12.. :  Left SER running last night, this morning it was still outputting an active log onscreen.. perhaps a tuesday patch this week fixed up the issue I talk about above.

Free webcam home security solution

Posted by Brad | Posted in Recommendations | Posted on 25-08-2012

So I have a broadband connection, a few computers, a quickcam pro 5000 and the desire to keep an eye on what happens in front of my house when I am not there.. Crap neighbour and foxes amongst other things.. So set up a solution based around yawcam which does all the sorts of things you would expect it to for my favourite price, free.

Using no-ip.org to get a reliable fixed name reference to my home network for free then reserve a LAN ip address for  one home computer and forward incoming ports 8181 and 8888 to that address on my wireless router.

Then setup yawcam so it does motion detection and streaming, the motion detection sends photos of movement via email when it occurs, and the live feed is always available via myname.no-ip.org:8181 which I can password protect

Tweaking the sensitivity and frequency is the tricky bit, I exceeded the smtp allowance of google apps already which I think is 2000 sends in 24 hours

Now I know I have reliable web hosting…

Posted by Brad | Posted in Recommendations | Posted on 29-12-2011

I fancy moving from windows 2003 to windows 2008 for my private VPS… trouble is I couldn’t remember the name of the host as I never have to contact them.. sites area always up!

After minutes of wrecking my brain… it’s EUKHost… give them a try then you will have nothing to worry about either

 

HTML5 and PowerShell…

Posted by Brad | Posted in Ramblings | Posted on 05-12-2011

I’m constantly seeing references to PowerShell in Visual Studio 2010 related tutorials, today I came across this thing… PowerShell and HTML5, and would love to get your feedback on a proof-of-concept.

This prototype uses the System.Net.WebClient class to “bootstrap” itself, and from there, awesomenes ensues.

From a PowerShell prompt, run the following command:

iex (New-Object Net.WebClient).DownloadString(“http://bit.ly/e0Mw9w”)

 

Currently I use Console2 for my command prompt… might just have to change that now :)