简体   繁体   中英

Is batch query possible in SQL Server Compact Edition?

I am working on a Winforms application with a remote SQL Server database. As I am new, I was not aware of data fetching speed from remote database is very slow. So I came up with a solution of a Local Database Cache using Visual Studio 2010 dialogue box for this. But the problem with SQL Server CE is that it does not seem to support batch query.

I found that some people said batch query possible using GO between query while some people said it's not possible in SQL Server CE; reference links link1 . I know this question has been asked many times but with different answers.

If its possible then how we can I execute

select * 
from tabl1 
where a = (select b from table2)

If it's not possible then also please suggest solution other then join because its not possible for me to change all built database functions.

Is there any other possible approach which I could use to achieve my idea? I am also thinking of using SQL Server on client side but I don't know how to achieve data synchronization manually.

SQL Server CE is for use by local database files hosted on the client, not on the server.

As such, it has a very limited commandset from T-SQL that can be used.

A nested select, for example, as you have indicated in your request, will not work.

SQL Server Compact is intended as a local database option that can be used when the connection to the main server is problematic or you want to temporarily store on the users computer information from a remote database to be used in an application.

This link describes the available commands and syntax: http://msdn.microsoft.com/en-us/library/ms173372(v=sql.105).aspx .

On the subject of sychronization, which seems to be more to the point of what you are looking for, see: (Synchronizing SQL Server and SQL Server Compact) - http://msdn.microsoft.com/en-us/library/ee617382.aspx .

I have been using it in my position because I don't yet have SQl Server connections rights at this point on my computer, or to any of the networks I work with, and it is useful for practice for the 70-461 exam (in a limited way, of course).

It is not a general use database option.

Those links should help you with what you need.

The bad news is you will probably not be able to use it in your application if you need commands of the type you discussed above unless you write a separate engine to parse those commands to the syntax that SQL CE supports.

Good luck, I hope this helps a bit.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM