if NOT exists (select * from sysobjects where name = N'tbl_PosOption')
Begin
CREATE TABLE [dbo].[tbl_PosOption](
	[Id] [smallint] IDENTITY(1,1) NOT NULL,
	[ComputerName] [varchar](50) NOT NULL,
	[OverUnderId] [smallint] NOT NULL,
	[DeviceIP] [varchar](15) NOT NULL,
	[Service] [smallint] NULL,
	[CommunicationPort] [nvarchar](25) NULL,
	[isActive] [bit] NULL,
 CONSTRAINT [PK_tbl_PosOption] PRIMARY KEY CLUSTERED 
(
  [Id] ASC
)
) ON [PRIMARY]

ALTER TABLE [dbo].[tbl_PosOption] ADD  CONSTRAINT [DF_tbl_PosOption_Flag]  DEFAULT ((1)) FOR [Service]
ALTER TABLE [dbo].[tbl_PosOption] ADD  CONSTRAINT [DF_tbl_PosOption_isActive]  DEFAULT ((1)) FOR [isActive]


ALTER TABLE [dbo].[tbl_PosOption]  WITH CHECK ADD  CONSTRAINT [FK_tbl_PosOption_Over_Under] FOREIGN KEY([OverUnderId])
REFERENCES [dbo].[Over_Under] ([AutoId])
ON DELETE CASCADE

End

