would it be possible to use the SD card as the storage location for the sketch code?

Technically, since the ATmega is capable of self-programming, the answer is yes.

Practically, the answer is no. Since there is no way to run code from the external device, you would be required to copy code from the SD card to flash, run the code, then reprogram the flash with whatever code you need to run next. This is slow, complicated, and the flash has a limited number of write cycles, which means the ATmega would die an early death.

Quote

maybe in a dual core setup.

I think this has more potential, but not in the way you say. The dedicated ATmega would provide FAT filesystem support and interface to the SD card. FTDI has already done this with the Vinculum, although with a USB interface and not directly to SD.

Because raw is difficult to deal with if you want to pop the SD card out of the arduino and put it into a computer to exchange data. If you use FAT on the SD card, you already have FAT filesystem drivers on all major operating systems. If you use some raw format, you must write custom code for every possible operating system that you wish to exchange data with.

triffid.hunter

AVR 8-bit microcontrollers are (modified) harvard architecture. that means that the program and data memory are completely separate except for the special ability to load program data into ram such as string constants, so you can't load anything into ram then run it as if it was code, like you can on von neumann architectures such as desktop PCs.

This basically means that we can only use SD for data. If you want to store code on one, you will have to write your own language and interpreter, or use a microcontroller with a von neumann architecture instead of the atmega168 on your arduino.

Sorry, Triffid, but as I said the ATmega is capable of self-programming, so yes it is technically possible for it to pull code from the SD card, write it to flash, and execute it. This really isn't any different conceptually from pulling the data from a serial port and writing it to flash, which is exactly what the Arduino bootloader does for us, allowing us to program the ATmega without a hardware programmer.

As I said earlier I don't think it's terribly practical, but it absolutely is possible.