sql-server-cesql-server-ce-3.5

Query two separate SQL Compact databases from SQL Server Management Studio


I have two different SQL Server Compact (sdf) database files and I want to use SQL Server Management Studio to update a table in one of the sdfs with rows from the other.

With traditional SQL Server mdf databases, it's possible to refer to two tables in two separate databases using their full paths [database1].[dbo].[table] and [database2].[dbo].[table].

I have not been able to work out a way to do this for sdfs - is it even possible?


Solution

  • No, it is not possible to Query SQL Compact databases across files. You must load the relevant data in memory, and use LINQ to Objects if you want a Consolidated result, or replicate the SQL Compact database to a single SQL Server database.