Dynamic SQL scripting on Windows Phone 7 with LINQ

I recently had cause to look into running dynamic SQL on WP7 for a customer. On a desktop this is easy, you just run some SQL statements through ADO.NET and you’re sorted. On Windows Phone 7 it’s a little trickier. This is because WP7 only exposes LINQ to SQL and it doesn’t support arbitrary SQL execution against your SQL CE databases.

So how to handle it when you have a corrupt DB and want to send a fix to a remote device or you just want to update the DB with some new data.