/*
Table semaphore implements the semaphore logic of the
admin subsystem. In this subsystem the use is limited
to controlling access to the textreader entity.
The status column is set to 1 to hold the semaphore and
then to 0 to free the semaphore.
*/
IF EXISTS (SELECT * FROM sysobjects
WHERE id = OBJECT_ID('dbo.semaphore')
AND sysstat & 0xf = 3)
DROP TABLE dbo.semaphore
GO
CREATE TABLE dbo.semaphore (
name VARCHAR(30) NOT NULL ,
status TINYINT NOT NULL ,
CONSTRAINT PK_semaphore PRIMARY KEY CLUSTERED
(
name
)
)
GO