Wednesday, March 31, 2010

How to Open SQL Server Mobile / Compact Edition Data Files on a PC

After alot of mis-information and redirection, I finally found a way to open and view the contents of a SQL Server Mobile (or Compact) Edition data file.

Sometimes with an ".sdf" and sometimes with a ".mdf" (I actually think it's arbitrary what the extention is, so long as the format is good), these compact data files can be opened using Visual Studio. From the File menu, select > Open > File item. Select the mobile database file, then it will show up in the "Data Sources" toolbox. You can navigate artifacts of the database, as well as view the contents, copying out to Excel if necessary.

SInce I was dealing with a mobile database file created using the 3.5 components, I had to open my .mdf file up in VS2008 and not VS2005 (I have them both installed for such circumstances). However, from what I was reading online, VS2005 is required to open CF mobile databases from the 2.0 days.

This was all due to a SQL server publication being accidentally deleted by an automated batch script between production servers. On a side note, after re-creating the [very simple] publication using the same source, name, articles, web synchronization URL, target folder, and publication access list members, the old subscription mobile databases actually successfully synchronized with the 'new' publication.

I'm at a point where the words "who cares" now show up in the wrinkles produced on my forehead due to the permanent smirk I've adopted today.



Light years, though, beyond where I started with Microsoft's replication efforts, back with Access replicas, then on to SQL 2000 replication (f*ing nightmare), 2005 replication (much improved), and now SQL Server 2008 with 2005 mobile components. Thank jebus for experience.

No comments:

Post a Comment