USE [EnVisage]
GO

IF not EXISTS (SELECT * FROM sys.tables where name='supt_tbl_RecParser')
BEGIN
	CREATE TABLE [dbo].[supt_tbl_RecParser](
		[Id] [uniqueidentifier] NOT NULL,
		[ProcessID] [varchar](50) NOT NULL,
		[ToType] [varchar](50) NULL,
		[ToName] [varchar](50) NULL,
		[ToField] [varchar](50) NULL,
		[StartPos] [int] NULL,
		[Length] [int] NULL,
		[index] [int] NULL,
		[isDelimited] [char](1) NULL,
		[Delimitor] [nvarchar](5) NULL,
		[AdditionalFormat] [varchar](50) NULL,
		[Overlay] [bit] NULL,
		[DBFieldFormat] [int] NULL,
		[TableOrder] [int] NULL,
		[ForeignKey] [bit] NULL,
		CONSTRAINT [PK_supt_tbl_FileParser] PRIMARY KEY CLUSTERED 
	(
		[Id] ASC
	)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON, FILLFACTOR = 90) ON [PRIMARY]
	) ON [PRIMARY]
END
GO

IF not EXISTS (SELECT * FROM sys.default_constraints where name='DF_supt_tbl_RecParser_Id')
BEGIN
	ALTER TABLE [dbo].[supt_tbl_RecParser] ADD  CONSTRAINT [DF_supt_tbl_RecParser_Id]  DEFAULT (newid()) FOR [Id]
END
