SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO


-- GT11_EMAIL1
	IF EXISTS(
		SELECT
			TOP 1 1
		FROM
			SYSCOLUMNS
		INNER JOIN SYSOBJECTS
		ON SYSOBJECTS.ID = SYSCOLUMNS.ID
		WHERE
			SYSCOLUMNS.NAME = 'GT11_EMAIL1'
		AND SYSOBJECTS.NAME = 'GT11_CONTATTI'
		AND SYSCOLUMNS.xtype = 167
		AND length = 100
	)
		BEGIN
		   ALTER TABLE GT11_CONTATTI

			ALTER COLUMN GT11_EMAIL1 varchar(128) NULL
		
		   PRINT 'Tabella GT11_CONTATTI: campo GT11_EMAIL1 modificato'

		END
	GO



-- GT11_EMAIL2
	IF EXISTS(
		SELECT
			TOP 1 1
		FROM
			SYSCOLUMNS
		INNER JOIN SYSOBJECTS
		ON SYSOBJECTS.ID = SYSCOLUMNS.ID
		WHERE
			SYSCOLUMNS.NAME = 'GT11_EMAIL2'
		AND SYSOBJECTS.NAME = 'GT11_CONTATTI'
		AND SYSCOLUMNS.xtype = 167
		AND length = 100
	)
		BEGIN
		   ALTER TABLE GT11_CONTATTI

			ALTER COLUMN GT11_EMAIL2 varchar(128) NULL
		
		   PRINT 'Tabella GT11_CONTATTI: campo GT11_EMAIL2 modificato'

		END
	GO
