USE [ETLConfig]
GO


ALTER TABLE [biml].[TableLoadColumn] DROP CONSTRAINT [FK_TableLoadColumn_TableLoadColumn]
GO


/****** Object:  Table [biml].[TableLoadColumn]    Script Date: 10/26/2016 4:33:35 PM ******/
DROP TABLE [biml].[TableLoadColumn]
GO


CREATE TABLE [biml].[TableLoadColumn](
	[TableLoadColumnID] [int] IDENTITY(1,1) NOT NULL,
	[TableLoadID] [int] NOT NULL,
	[SourceColumnName] [varchar](50) NOT NULL,
	[DestinationColumnName] [varchar](50) NOT NULL,
	[ColumnType] VARCHAR(10) NOT NULL
 CONSTRAINT [PK_TableLoadColumn] PRIMARY KEY CLUSTERED 
(
	[TableLoadColumnID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO



/****** Object:  Table [biml].[TableLoad]    Script Date: 10/26/2016 4:33:24 PM ******/
DROP TABLE [biml].[TableLoad]
GO


CREATE TABLE [biml].[TableLoad](
	[TableLoadID] [INT] IDENTITY NOT NULL,
	[ProcessName] [VARCHAR](20) NOT NULL,
	[SourceDatabaseName] [VARCHAR](50) NOT NULL,
	[SourceSchemaName] [VARCHAR](50) NOT NULL,
	[SourceTableName] [VARCHAR](50) NOT NULL,
	[DestinationDatabaseName] [VARCHAR](50) NOT NULL,
	[DestinationSchemaName] [VARCHAR](50) NOT NULL,
	[DestinationTableName] [VARCHAR](50) NOT NULL,
 CONSTRAINT [PK_TableLoad] PRIMARY KEY CLUSTERED 
(
	[TableLoadID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]

GO



ALTER TABLE [biml].[TableLoadColumn]  WITH CHECK ADD  CONSTRAINT [FK_TableLoadColumn_TableLoadColumn] FOREIGN KEY([TableLoadID])
REFERENCES [biml].[TableLoad] ([TableLoadID])
GO

ALTER TABLE [biml].[TableLoadColumn] CHECK CONSTRAINT [FK_TableLoadColumn_TableLoadColumn]
GO

