/**************************/
USE [Actions02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO

UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [AppraisalSections02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO

UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO



/**************************/
USE [Appraisals02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [BugTrk02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [ChangeRequests02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [Configuration02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [HelpDesk02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [Installations02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO



/**************************/
USE [InventoriedSoftware02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO



/**************************/
USE [KnowledgeBase02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [LicenseManager02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [Purchases&Agreements02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO



/**************************/
USE [ReleaseMgmt02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [Resources02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


/**************************/
USE [Roles02_Def]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO
	
UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO



/**************************/
USE [Users_mdb]
GO

/*** NEW FIELD SUB TYPE ***/
IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDtsTables' AND COLUMN_NAME = 'nSubType' )
	ALTER TABLE [dbo].[tblDtsTables] ADD [nSubType] [int] NULL;
GO

UPDATE [dbo].[tblDtsTables] 
	SET nSubType=110 
	WHERE nRelationshipType=2 AND tTableName = 'tblAttachments';
	
GO


