It could even be that the SATA controller chip is bad, so if you remove the HD, partition it, and put it back in it still may not work if the chip is bad.
If you have an extra SATA drive you might want to try it in place of what's in the machine before buying a case to see if it is the controller or the HD.
West coast of Ireland, miles from any Apple help if things go wrong. Will sleep on it and decide in morning whether to connect it live as I'm not sure I could get it all back together if I dismantle it
I have a SATA drive from a cctv system but how do I format it? Is it the same if I buy a SSD?
Just put it in. If you can boot off of the USB drive you can use Disk Utility to format it. DU on Mac will format any kind of drive. Just use the partitioning scheme I outline above, my 5th post or so ? to make it a GUID drive with an HFS partition. Make sure you choose the whole disk, not the icon on the bottom right of the drive. If you get that far you'll see what I mean, one will give you the Partition option, the other won't. Erase will keep whatever it is formatted as, probably Master Boot Record (MBR) now, so choose Partition.
Don't buy the SSD yet, let's see if the HD is the problem and not the logic board first.