SQL Server 数据库同步
SQL Server 是否同步以兼容多个进程?我是否必须进行同步才能与数据库一起使用,以便同时使用多个进程?
Is the SQL Server synchronized to be compatible with many processes? Do i have to make synchronization to be possible to work with DataBases so that more than 1 process be used at the same time?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Sql Server 旨在处理同时处理同一数据的多个进程(通过各种锁定机制等)。您还可以通过 SET TRANSACTION ISOLATION 语句控制同步/隔离级别。 ( http://msdn.microsoft.com/en-us/library/ms173763 .aspx )
Sql Server is designed to handle multiple processes working on the same data simultaneously (via various lock mechanisms etc). You can also control the level of synchronization / isolation via
SET TRANSACTION ISOLATION
statement. ( http://msdn.microsoft.com/en-us/library/ms173763.aspx )SQL Server 将为您管理同步。请参阅数据库事务和隔离级别了解更多详细信息。
SQL Server will manage the synchronization for you. See database transactions and isolation levels for more details.
我要看你需要什么。如果您的所有进程都从数据库中读取,那么您可以完全忽略并发性。
如果您有复杂的写入操作,需要执行多个查询,并且您希望它们是原子的 - 请查看事务(或者如果您的应用程序允许它尝试从单个进程执行它们)。
I depends on what you need. If all your processes are reading from the database - than you can ignore the concurrency altogether.
If you have complex write operations, which need to execute multiple queries, and you wish them to be atomic - look into transactions (or if your application allows it try to execute them from a single process).