-----------------------------------------------------------------------------------------'
--  Script modifica tabella GT13_DESTINATARI campo GT13_AGENTE_MG17
--  campo codice_agente --> nchar(20)
-----------------------------------------------------------------------------------------'

	if exists (
		select top 1 1
		from  SYSCOLUMNS  with (nolock)
		INNER JOIN SYSOBJECTS  with (nolock) 
			ON SYSOBJECTS.ID = SYSCOLUMNS.ID 
		WHERE SYSCOLUMNS.name = 'GT13_AGENTE_MG17'
			and SYSOBJECTS.NAME = 'GT13_DESTINATARI'
			and length = 4
	)
	begin
		alter table GT13_DESTINATARI
		alter column GT13_AGENTE_MG17 nchar(20) null

		Print 'Modificata tabella GT13_DESTINATARI campo GT13_AGENTE_MG17'
	end 
	GO