-----------------------------------------------------------------------------------------'
-- Aggiunta campo GT02_IDAU
-----------------------------------------------------------------------------------------'

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

		ADD GT02_IDAU bigint NULL
		
	   PRINT 'Tabella GT02_CLIENTIFORNITORI: campo GT02_IDAU creato'

	END
ELSE
	BEGIN
	PRINT 'Tabella GT02_CLIENTIFORNITORI: campo GT02_IDAU esistente, creazione non effettuata'
	END
GO