sql server with semaphore