One of the nice features of SQL Server Compact (SSC) is portability. Each database is fully self-contained in a single file and that file can be freely moved between Windows Mobile Devices, and desktop or server computers. It turns out that this portability may result in some unexpected, and potentially painful, behavior.
You may find that a SSC database you create on a Windows Vista computer results in a long-delay when you attempt to open the SSC database on a Windows Mobile device. However, if you create the SSC database on a Windows XP computer, the database opens on a Windows Mobile device with no delay.
The problem occurs because Windows Vista and Windows Server 2008 use a different sort order than that used by earlier Windows versions - As we all know, indexes are based on sort order.
SSC indexing needs to be consistent with the sort-order of the host platform. As a result, when you open a SSC database, the SSC engine checks to see if the sort order used to create the database indexes is the same as the sort-order of the host platform. If the sort orders are different, SSC rebuilds all of indexes in the database. Fortunately, once the new indexes are built, all future attempts to open the database on the current platform will occur without delay.
This is certainly something to keep in mind if you're thinking of upgrading from Windows XP to Windows Vista or Windows Server 2003 to Windows Server 2008 if you have a process that creates or exchanges SSC database files with Windows Mobile devices.
Posted
Jan 23 2008, 11:54 AM
by
jim-wilson