Archive for 2012

Tech plans for 2013

Just a quick post on my technical plans for 2013… SQL Server 2012 – I moved our primary SQL Server system across to a SQL Server 2008 R2 Cluster this year so I can’t see us upgrading for a while. That said it’ll be good to get ahead of the game and start experimenting with […]

MySQL Cursor bug?

I came across this little funny with MySQL cursors today. This may be documented somewhere in the manual but I couldn’t find it. Thought I’d post it here for anyone else experiencing cursor issues with MySQL. First, a quick illustration of the issue… This stored procedure has valid syntax and compiles (in 5.1 & 5.4). […]

Monitor /tmp usage on Linux

Just a quick post to show how to monitor usage of /tmp on a Linux system. Setup a cron job as follows… ?View Code BASH* * * * * df -h | grep "/tmp" >> /tmp/tmp.log This job will run every one minute logging details of /tmp usage to a file called tmp.log. To report […]

Table-Valued Parameters need an alias!

I’m always the one to say RTFM but this one stumped me for a while. I had problems using a Table-Valued Parameter in a Stored Procedure today. The explanation is indeed in the documentation but it’s perhaps not as clear as it should be. Hopefully this post will be picked up better in Google for […]

Linux Tip: Output error messages to syslog from cron

I wanted to find a way of running a script in cron and output the exit code, and error message, to syslog if it failed. Here’s what I came up with… ?View Code BASHoutput=`/usr/bin/scripts/test.sh 2>&1`; code=$?; if [ "$code" -ne 0 ]; then err_msg=`echo "$output" | tail -1`; logger -t "CRONERROR" "Exit Code = $code: […]