SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO

-----------------------------------------------------------------------------------------'
-- Aggiunta campo GT06_INDTIPOARTCM											 
-----------------------------------------------------------------------------------------'

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

		ADD GT06_INDTIPOARTCM tinyint NULL
		
	   PRINT 'Tabella GT06_ARTICOLI: campo GT06_INDTIPOARTCM creato'

	END
ELSE
	BEGIN
	PRINT 'Tabella GT06_ARTICOLI: campo GT06_INDTIPOARTCM esistente, creazione non effettuata'
	END
GO
