IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[IES].[T_INTEGRATION_QUEUE]') AND type in (N'U'))
ALTER TABLE [IES].[T_INTEGRATION_QUEUE] DROP CONSTRAINT [FK_T_LOAD_SETTINGS_T_INTEGRATION_QUEUE_LoadSettings]
GO

ALTER TABLE [IES].[T_INTEGRATION_QUEUE]  WITH CHECK ADD  CONSTRAINT [FK_T_LOAD_SETTINGS_T_INTEGRATION_QUEUE_LoadSettings] FOREIGN KEY([LoadSettings])
REFERENCES [FNS].[T_LOAD_SETTINGS] ([LoadSettingsID])
GO

ALTER TABLE [IES].[T_INTEGRATION_QUEUE] CHECK CONSTRAINT [FK_T_LOAD_SETTINGS_T_INTEGRATION_QUEUE_LoadSettings]
GO

DROP table IES.T_LOAD_SETTINGS_PATTERNS
DROP table IES.T_FILE_PATTERN  
DROP table IES.T_VERIFICATION_PATTERN 
DROP table IES.T_LOAD_SETTINGS  
GO