IF NOT EXISTS(
    SELECT
        TOP 1 1
    FROM
        SYSCOLUMNS
    INNER JOIN SYSOBJECTS
	ON SYSOBJECTS.ID = SYSCOLUMNS.ID
    WHERE
        SYSCOLUMNS.NAME = 'GT04_SYNCTU'
	AND SYSOBJECTS.NAME = 'GT04_DOCCORPO'
)
	BEGIN
	   ALTER TABLE GT04_DOCCORPO

			ADD GT04_SYNCTU TINYINT NULL 

	   PRINT 'Tabella GT04_DOCCORPO: campo GT04_SYNCTU creato'

	END
ELSE
	BEGIN
		PRINT 'Tabella GT04_DOCCORPO: campo GT04_SYNCTU esistente, creazione non effettuata'
	END
GO


IF NOT EXISTS(
    SELECT
        TOP 1 1
    FROM
        SYSCOLUMNS
    INNER JOIN SYSOBJECTS
	ON SYSOBJECTS.ID = SYSCOLUMNS.ID
    WHERE
        SYSCOLUMNS.NAME = 'GT04_SYNCGE'
	AND SYSOBJECTS.NAME = 'GT04_DOCCORPO'
)
	BEGIN
	   ALTER TABLE GT04_DOCCORPO

			ADD GT04_SYNCGE TINYINT NULL 

	   PRINT 'Tabella GT04_DOCCORPO: campo GT04_SYNCGE creato'

	END
ELSE
	BEGIN
		PRINT 'Tabella GT04_DOCCORPO: campo GT04_SYNCGE esistente, creazione non effettuata'
	END
GO
