SQL 2005 Session Synchronization

Session synchronization is useful when you need different sql server sessions to be synched. You can use Logical Locking with Microsoft's built in lock manager.

Functions in SQL Server 2005

 * sp_getapplock
 * sp_releaseapplock

CDYNE's use
We use this for our Phone Notify service when we synchronize our dialer boxes asking for phone numbers to dial. This allows us to be 100% sure that the same call won't be picked up by 2 or more dialing boxes at the same time. Using this method we have been able to scale our systems to dial 1000's of numbers within seconds.

Credits
Special thanks to Todd Carrico for putting me in the correct direction. If you run his code in the master database it works fine. But, due to the master.dbo.sp_getapplock and not using the master.dbo. in the releaselock statements, it would only work on the master database. http://sqljunkies.com/WebLog/tcarrico/archive/2005/04/12/11296.aspx