Serial ATA cables are available in many lengths up to 1 meter. Minimum cable length is 12 inches, using shorter cables can cause timing, or noise interference on the cable. The same conditions apply to cables that are too long. Though the Serial ATA specification calls out supporting cable lengths up to 1 meter or 39.37 inches, PCB traces from the cable connection to the host and drive controllers ASIC, adds length to the bus.
Example: SATA drive installed with a 40 inch cable. PCB trace from Serial host connector to the serial hosts ASIC = 3 inches. The same 3 inch PCB trace applies to the hard disk. This configuration gives you a bus length of about 46 inches. If you are having performance or data corruption issues, try using a shorter cable or different manufacturer of cable. Cable quality can vary between vendors.