USE Resources01_Dat
GO

IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDts' AND COLUMN_NAME = 'dLastInstallationsValidation' )
BEGIN
	ALTER TABLE [dbo].[tblDts] ADD [dLastInstallationsValidation] [datetime] NULL
END

IF NOT EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDts' AND COLUMN_NAME = 'Discovery_Location' )
BEGIN
	ALTER TABLE [dbo].[tblDts] ADD [Discovery_Location] [int] NULL
END

IF EXISTS(SELECT * FROM INFORMATION_SCHEMA.COLUMNS WHERE  TABLE_NAME = 'tblDts' AND COLUMN_NAME = 'Assets_Remaining' )
	EXEC sp_rename 'tblDts.Assets_Remaining', 'Total_Available', 'COLUMN';  

GO

