Steps:
- Remove WSUS and WID roles from server manager. Reboot server.
- Go to C:\Windows\WID\Data
- Move both "SUSDB.mdf" and "SUSDB_log.ldf" to another temp folder
- Re-install WSUS server role again
Found a comprehensive guide on http://prajwaldesai.com/troubleshooting-wsus-3-0-sp2-on-windows-server/