Home All Groups Group Topic Archive Search About

moving data between SQL Mobile and SQL server DBs

Author
13 Nov 2007 4:25 PM
TigerFanInAtlanta
I have connected to both a SQL Server Mobile and a SQL Server DB in
management studio. How can I write a query that selects rows from a
table in the Mobile DB and inserts them into the server DB.

Author
13 Nov 2007 10:21 PM
Erland Sommarskog
(TigerFanInAtla***@gmail.com) writes:
> I have connected to both a SQL Server Mobile and a SQL Server DB in
> management studio. How can I write a query that selects rows from a
> table in the Mobile DB and inserts them into the server DB.

You would set up a linked server and the use four-part notation:

   INSERT localtbl(....)
      SELECT ...
      FROM   MOBILE.db.sch.tbl
      WHERE  ...

Here I have assumed that you have called the linked server MOBILE.

You use sp_addlinkedserver to set up a linked server. Sorry, I don't
have any examples on how to this for SQL Mobile, but there may be
examples in Books Online.



--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx
Author
14 Nov 2007 9:22 PM
TigerFanInAtlanta
thanks Erland

I had tried that and should have said so in my post, but there doesn't
seem to be a way to create a linked server to an SQL Mobile database.

It's weird that I can connect to both the SQL Mobile DB and SQL2005 DB
in Management Studio, but can't move data from one to the other.

There must be a way.
Author
14 Nov 2007 10:46 PM
Erland Sommarskog
(TigerFanInAtla***@gmail.com) writes:
> I had tried that and should have said so in my post, but there doesn't
> seem to be a way to create a linked server to an SQL Mobile database.

I've never tried it myself, but there is definitely en OLE DB provider
for SQL Server Mobile, and an OLE DB provider is what it takes to set
up a linked server.

I was reading Books Online to find out what the name of the provider is,
but it was not really clear. It may be SQLSERVERCE, but I am not sure.


--
Erland Sommarskog, SQL Server MVP, esq***@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/prodtechnol/sql/2005/downloads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

AddThis Social Bookmark Button