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.

Restart required when installing SQL Server 2008

I just tried installing SQL Server 2008 and kept getting an error during the setup support rules phase of the install. It was insistent that my machine needed a reboot, after rebooting a few times I was pretty sure it didn’t really need a reboot.

After a little bit of trawling around I found this thread on the MSDN forums. Basically navigate to “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager” and delete any values in “PendingFileRenameOperations”.

Thanks to the post from Tomas Leung for that, I can now install SQL Server 2008.