问题
Where is the SQL Server Compact Edition 4.0 SDK?
Bonus Reading
In order to create a database in SQL Server Compact Edition you must call the function ME_CreateDatabase
exported from sqlceme40.dll
:

The function is not documented on MSDN, and the header files do not ship with the redistributable (obviously).
MSDN mentions 3 Compact Edition header files:
sqlce_err.h
: Error codes used by databasesqlce_oledb.h
: OLEDB standard programming interfacessqlce_sync.h
That page also mentions that, if i had the SDK, the header files would be located in:
SQL Server Compact 4.0 header files are installed under %ProgramFiles%\Microsoft SQL Server Compact Edition\v4.0\Include.
But i don't, so they aren't:

So where is the SQL Server Compact Edition 4.0 SDK?
Bonus Chatter
From MSDN:
Building an OLE DB Application (SQL Server Compact)
The next step in building an OLE DB-enabled application is to include the appropriate header files. In the main entry point for your application, add include statements for the SQL Server Compact OLE DB provider and the SQL Server Compact error file:
#include <sqlce_oledb.h> #include <sqlce_err.h >
回答1:
The files are included in the package SSCE 4.0 Design Tools (SSCEVSTools-ENU.msi) (documented here). This executable is available on the Visual Studio 2012 Premium Edition DVD. Possibly in other editions and verisons as well, but this is the only one I have.
I needed the files myself and after digging around for an hour I found it there.
回答2:
As Nitramk posted, I found SSCEVSTools-ENU.msi on the VS 2012 iso's in packages\ssce40. It's also included in the 2012 Ultimate trial (and probably Pro). As of now, the trials are still available from MS. Search for "visual studio 2012 ultimate trial" or "visual studio 2012 trial".
Note that I don't see them in VS 2013 or 2015.
回答3:
You have to use the 'Microsoft Web Platform Installer 3' link on the blog page and install that. Then you'll get the header files & samples installed into C:\Program Files (x86)\Microsoft SQL Server Compact Edition\v4.0
来源:https://stackoverflow.com/questions/10747518/sql-server-compact-edition-4-0-sdk