I don’t have to work a lot with SQL Server these days, but this evening I noticed that the maintenance tasks on one of my servers was not running. I went to the command line to run the task and got ‘SQL2005 or higher is required for sp_expressmaint’. Turns out there is a bug in the sp_expressmaint stored procedure that ships with SQL Server 2008 Express Edition. The first result on Google provided the solution. Luckily it’s really easy to fix. Just open up the stored procedures on your master database (they’re under ‘programability’). Then find this line:
IF (select SUBSTRING(@@version,(CHARINDEX('-',@@version) 2),1))