Monday, May 7, 2012

Visual Studio 11 beta - Tooling for SQL Server Compact

Visual Studio 11 beta includes SQL Server Compact 4.0 SP1 CTP1, as I blogged about here. In this post, I will describe in greater detail the tooling support included with Visual Studio 11 beta. Notice the Visual Studio 11 is in beta, and things can change before release.

image

Visual Studio 11 beta only supports SQL Server Compact 4.0 in Server Explorer and other tools, so no longer support for 3.5 SP2, for development with that, you can still reference the 3.5 DLL files, but will not get any built-in tooling support.

This also means, that the EDM Wizard now only supports 4.0, so no longer the confusing mix of 4.0 support for Web projects, and 3.5 support for other project types.

image

The Transact-SQL Editor in Premium and Ultimate, that previously supported SQL Server Compact 3.5 and 4.0 now only support SQL Server, sadly. So in order to analyse SQL Server Compact queries, you must have SQL Server 2008 R2 Management Studio Express  (which is a free product) installed.

image

The Server Explorer is “missing colours”, but otherwise looks familiar:

image

The Server Explorer dialogs for SQL Server Compact, that were previously available, look very much the same!

image

And you can still add a “Local Database”, which creates an empty SQL Server Compact 4.0 database in your project:

image

The SQL Server Compact Toolbox also works with Visual Studio 11 beta, notice that is also support connections to 3.5 database files!

image

4 comments:

Ji Xiang said...

Hi ErikEJ
There is no Transact-SQL Editor for SQLCE 4 in VS2012. How can I Execute .sqlce file which generated from my Entity Models to create a SQLCE 4 database?

ErikEJ said...

You can install the SQL Server Compact Toolbox, and use the SQL editor in thta tool

Java Jive said...

I'm finding that the generated DDL fails to execute via the SQL editor in the compact toolbox, generally because it includes code to drop tables and constraints that may note exist.

Is it possible to configure the tool to ignore those types of errors? More generally is it possible to run the DDL created from the 'Generate Database From Model' command without having to manually alter it?

ErikEJ said...

Java: It would be very helpful if you could create an issue with a sample script at sqlcetoolbox.codeplex.com/issues