Running SQL Server CE 4 Queries with Visual Studio

2019-01-15 20:29发布

问题:

I have recently upgraded to Visual Studio 2012 and SQL Server Management Studio 2012, however I cannot seem to see how to execute SQL scripts (created by Entity framework) on a SQL Server CE 4.0 database. With VS2010 + SSMS 2008 the Transact-SQL editor would ask for a connection and you could browse to the object, however this option is not available in SSMS 2012.

I have tried to execute the script via the Server Explorer -> New Query window, but I get parse errors. Any clues?

回答1:

Microsoft got rid of that for SSMS 2012, and suggested to use the integrated tools in WebMatrix instead (from memory, can't find a link for that sorry).

As suggested in that Microsoft Answers post, however, you could use the SQL Server Compact Toolbox, it's pretty effective.



回答2:

Try using the SQL Server Object Explorer instead of the Server Explorer. That should allow you to do what you wish.