﻿-- update tabelle
SET xact_abort ON
GO

BEGIN TRANSACTION
GO

ALTER TABLE Causali2FamMacchine DROP
  CONSTRAINT FK_Causali2FamMacchine_AnagCausali 
GO

ALTER TABLE InterventiMtz DROP
  CONSTRAINT FK_InterventiMtz_AnagCausali 
GO

EXEC sp_rename 'PK_AnagCausali', 'tmp__PK_AnagCausali', 'OBJECT'
GO

EXEC sp_rename 'AnagCausali', 'tmp__AnagCausali_0', 'OBJECT'
GO

CREATE TABLE AnagCausali(
  idxCausale     INT          NOT NULL IDENTITY CONSTRAINT PK_AnagCausali PRIMARY KEY,
  idxFamMacchine INT          NOT NULL,
  descrCausale   NVARCHAR(50),
  attiva         BIT          CONSTRAINT DF_AnagCausali_attiva DEFAULT (1)
)
GO

ALTER TABLE AnagCausali ADD
  CONSTRAINT FK_AnagCausali_AnagFamMacchine FOREIGN KEY(idxFamMacchine) REFERENCES AnagFamMacchine(idxFamMacchine) ON UPDATE CASCADE
GO

SET IDENTITY_INSERT AnagCausali ON
GO

INSERT INTO AnagCausali(idxCausale,idxFamMacchine,descrCausale) SELECT idxCausale,0,descrCausale FROM tmp__AnagCausali_0
GO

SET IDENTITY_INSERT AnagCausali OFF
GO

DROP TABLE tmp__AnagCausali_0
GO

ALTER TABLE InterventiMtz ADD
  CONSTRAINT FK_InterventiMtz_AnagCausali FOREIGN KEY(idxCausale) REFERENCES AnagCausali(idxCausale) ON UPDATE CASCADE
GO

COMMIT
GO


SET xact_abort ON
GO

BEGIN TRANSACTION
GO

ALTER TABLE AnagMacchine ALTER COLUMN
  nomeMacchina NVARCHAR(250)
GO

ALTER TABLE AnagMacchine ALTER COLUMN
  modello NVARCHAR(250)
GO

SET ANSI_NULLS ON
GO

ALTER PROCEDURE sp_caricaUpdateMAcchine
AS
INSERT INTO AnagMacchine
                      (codMacchina, nomeMacchina, modello, funzDal, idxImpianto, funzAl, kgPeso, kwConsumo, anno, matricola)
SELECT     ISNULL(tmp_importaMacchine.idGest, N'--') AS idxMacchina, ISNULL(tmp_importaMacchine.denominazione, N'nd') AS nomeMacchina, 
                      ISNULL(tmp_importaMacchine.costruttore, N'nd') AS modello, CAST(CAST(ISNULL(tmp_importaMacchine.anno, 1900) AS VARCHAR) + '-01-01 12:00:00' AS DATETIME) 
                      AS funzDal, AnagImpianti.idxImpianto, CAST('2100-01-01 00:00:00' AS DATETIME) AS fine, 1 AS kg, 1 AS kw, ISNULL(tmp_importaMacchine.anno, 1900) AS anno, 
                      '-' AS matr
FROM         tmp_importaMacchine INNER JOIN
                      AnagImpianti ON tmp_importaMacchine.reparto = AnagImpianti.nomeImpianto
RETURN
GO

COMMIT
GO


ALTER TABLE InterventoOpMtz ADD
  CONSTRAINT FK_InterventoOpMtz_AnagrOperMtz FOREIGN KEY(matrOp) REFERENCES AnagrOperMtz(matrOp) ON UPDATE CASCADE
GO


DROP TABLE Causali2FamMacchine
GO


-- update viste
SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

ALTER VIEW v_intervExp
AS
SELECT     TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.InterventiMtz.dataLav, dbo.InterventiMtz.turnoLav, dbo.InterventiMtz.matr, 
                      dbo.InterventiMtz.guasto, dbo.InterventiMtz.idxAmbito, dbo.AnagAmbitoGuasto.descrAmbitoGuasto, dbo.InterventiMtz.idxPriorita, dbo.AnagPriorita.descrPriorita, 
                      CASE dbo.InterventiMtz.isFermo WHEN 'True' THEN 'SI' ELSE 'NO' END AS isFermoSiNo, dbo.InterventiMtz.idxTipo, dbo.AnagTipoGuasto.descrTipo, 
                      dbo.InterventiMtz.idxImpianto, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto, dbo.InterventiMtz.idxMacchina, dbo.AnagMacchine.codMacchina, 
                      dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.idxStato, dbo.AnagStati.DescrStato, ISNULL(dbo.InterventiMtz.presaInCarico, 
                      dbo.InterventiMtz.richiesta) AS presaInCarico, ISNULL(dbo.InterventiMtz.inizioIntervento, ISNULL(dbo.InterventiMtz.presaInCarico, dbo.InterventiMtz.richiesta)) 
                      AS inizioIntervento, ISNULL(dbo.InterventiMtz.fineIntervento, GETDATE()) AS fineIntervento, dbo.InterventiMtz.descrizioneIntervento, 
                      dbo.InterventiMtz.isPreventivabile, dbo.InterventiMtz.idxCausale, ISNULL(dbo.AnagCausali.descrCausale, 'N.D.') AS descrCausale, dbo.InterventiMtz.isFermo
FROM         dbo.InterventiMtz INNER JOIN
                      dbo.AnagAmbitoGuasto ON dbo.InterventiMtz.idxAmbito = dbo.AnagAmbitoGuasto.idxAmbito INNER JOIN
                      dbo.AnagImpianti ON dbo.InterventiMtz.idxImpianto = dbo.AnagImpianti.idxImpianto INNER JOIN
                      dbo.AnagMacchine ON dbo.InterventiMtz.idxMacchina = dbo.AnagMacchine.idxMacchina INNER JOIN
                      dbo.AnagTipoGuasto ON dbo.InterventiMtz.idxTipo = dbo.AnagTipoGuasto.idxTipo INNER JOIN
                      dbo.AnagPriorita ON dbo.InterventiMtz.idxPriorita = dbo.AnagPriorita.idxPriorita INNER JOIN
                      dbo.AnagStati ON dbo.InterventiMtz.idxStato = dbo.AnagStati.idxStato LEFT OUTER JOIN
                      dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
ORDER BY dbo.InterventiMtz.numIntMtz DESC
GO

COMMIT
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

ALTER VIEW v_selCausaliMacchine
AS
SELECT     TOP (100) PERCENT dbo.AnagCausali.idxCausale AS value, dbo.AnagCausali.descrCausale AS label, dbo.Macchine2FamMacchine.idxMacchina AS conditio
FROM         dbo.Macchine2FamMacchine INNER JOIN
                      dbo.AnagCausali ON dbo.Macchine2FamMacchine.idxFamMacchine = dbo.AnagCausali.idxFamMacchine
WHERE     (dbo.AnagCausali.attiva = 1)
ORDER BY conditio, label
GO
EXEC sp_addextendedproperty 'MS_DiagramPane1', '[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "Macchine2FamMacchine"
            Begin Extent = 
               Top = 15
               Left = 448
               Bottom = 93
               Right = 606
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "AnagCausali"
            Begin Extent = 
               Top = 54
               Left = 38
               Bottom = 162
               Right = 196
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'SCHEMA', 'dbo', 'VIEW', 'v_selCausaliMacchine'
GO

EXEC sp_addextendedproperty 'MS_DiagramPaneCount', 1, 'SCHEMA', 'dbo', 'VIEW', 'v_selCausaliMacchine'
GO

COMMIT
GO


IF NOT object_id('v_mtzProgPendingExp') IS NULL
DROP VIEW v_mtzProgPendingExp
GO



SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

CREATE VIEW v_mtzProgPendingExp
AS
SELECT     TOP (100) PERCENT dbo.MtzProgPending.idxPending, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto, dbo.AnagMacchine.codMacchina, 
                      dbo.AnagMacchine.nomeMacchina, dbo.MtzProgPending.data, dbo.MtzProgPending.descrizione, dbo.AnagPriorita.descrPriorita, dbo.MtzProgPending.isFermo, 
                      dbo.AnagTipoGuasto.descrTipo
FROM         dbo.MtzProgPending INNER JOIN
                      dbo.AnagMacchine ON dbo.MtzProgPending.idxMacchina = dbo.AnagMacchine.idxMacchina INNER JOIN
                      dbo.AnagImpianti ON dbo.AnagMacchine.idxImpianto = dbo.AnagImpianti.idxImpianto INNER JOIN
                      dbo.AnagTipoGuasto ON dbo.MtzProgPending.idxTipo = dbo.AnagTipoGuasto.idxTipo INNER JOIN
                      dbo.AnagPriorita ON dbo.MtzProgPending.idxPriorita = dbo.AnagPriorita.idxPriorita
ORDER BY dbo.MtzProgPending.data
GO

EXEC sp_addextendedproperty 'MS_DiagramPane1', '[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "MtzProgPending"
            Begin Extent = 
               Top = 57
               Left = 597
               Bottom = 228
               Right = 748
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "AnagMacchine"
            Begin Extent = 
               Top = 33
               Left = 341
               Bottom = 253
               Right = 492
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "AnagImpianti"
            Begin Extent = 
               Top = 83
               Left = 127
               Bottom = 226
               Right = 278
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "AnagTipoGuasto"
            Begin Extent = 
               Top = 182
               Left = 869
               Bottom = 260
               Right = 1020
            End
            DisplayFlags = 280
            TopColumn = 0
         End
         Begin Table = "AnagPriorita"
            Begin Extent = 
               Top = 16
               Left = 874
               Bottom = 109
               Right = 1025
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 10
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 1', 'SCHEMA', 'dbo', 'VIEW', 'v_mtzProgPendingExp'
GO

EXEC sp_addextendedproperty 'MS_DiagramPane2', '1
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'SCHEMA', 'dbo', 'VIEW', 'v_mtzProgPendingExp'
GO

EXEC sp_addextendedproperty 'MS_DiagramPaneCount', 2, 'SCHEMA', 'dbo', 'VIEW', 'v_mtzProgPendingExp'
GO

COMMIT
GO


IF NOT object_id('v_selOperMtz') IS NULL
DROP VIEW v_selOperMtz
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

CREATE VIEW v_selOperMtz
AS
SELECT     TOP (100) PERCENT matrOp AS value, matrOp + ' - ' + Cognome + ' ' + Nome AS label
FROM         dbo.AnagrOperMtz
ORDER BY label
GO

EXEC sp_addextendedproperty 'MS_DiagramPane1', '[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "AnagrOperMtz"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 99
               Right = 190
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
      Begin ColumnWidths = 9
         Width = 284
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
         Width = 1500
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'SCHEMA', 'dbo', 'VIEW', 'v_selOperMtz'
GO

EXEC sp_addextendedproperty 'MS_DiagramPaneCount', 1, 'SCHEMA', 'dbo', 'VIEW', 'v_selOperMtz'
GO

COMMIT
GO


IF NOT object_id('v_selFam') IS NULL
DROP VIEW v_selFam
GO


SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

CREATE VIEW v_selFam
AS
SELECT     idxFamMacchine AS value, nomeFamMacch AS label
FROM         dbo.AnagFamMacchine
GO

EXEC sp_addextendedproperty 'MS_DiagramPane1', '[0E232FF0-B466-11cf-A24F-00AA00A3EFFF, 1.00]
Begin DesignProperties = 
   Begin PaneConfigurations = 
      Begin PaneConfiguration = 0
         NumPanes = 4
         Configuration = "(H (1[40] 4[20] 2[20] 3) )"
      End
      Begin PaneConfiguration = 1
         NumPanes = 3
         Configuration = "(H (1 [50] 4 [25] 3))"
      End
      Begin PaneConfiguration = 2
         NumPanes = 3
         Configuration = "(H (1 [50] 2 [25] 3))"
      End
      Begin PaneConfiguration = 3
         NumPanes = 3
         Configuration = "(H (4 [30] 2 [40] 3))"
      End
      Begin PaneConfiguration = 4
         NumPanes = 2
         Configuration = "(H (1 [56] 3))"
      End
      Begin PaneConfiguration = 5
         NumPanes = 2
         Configuration = "(H (2 [66] 3))"
      End
      Begin PaneConfiguration = 6
         NumPanes = 2
         Configuration = "(H (4 [50] 3))"
      End
      Begin PaneConfiguration = 7
         NumPanes = 1
         Configuration = "(V (3))"
      End
      Begin PaneConfiguration = 8
         NumPanes = 3
         Configuration = "(H (1[56] 4[18] 2) )"
      End
      Begin PaneConfiguration = 9
         NumPanes = 2
         Configuration = "(H (1 [75] 4))"
      End
      Begin PaneConfiguration = 10
         NumPanes = 2
         Configuration = "(H (1[66] 2) )"
      End
      Begin PaneConfiguration = 11
         NumPanes = 2
         Configuration = "(H (4 [60] 2))"
      End
      Begin PaneConfiguration = 12
         NumPanes = 1
         Configuration = "(H (1) )"
      End
      Begin PaneConfiguration = 13
         NumPanes = 1
         Configuration = "(V (4))"
      End
      Begin PaneConfiguration = 14
         NumPanes = 1
         Configuration = "(V (2))"
      End
      ActivePaneConfig = 0
   End
   Begin DiagramPane = 
      Begin Origin = 
         Top = 0
         Left = 0
      End
      Begin Tables = 
         Begin Table = "AnagFamMacchine"
            Begin Extent = 
               Top = 6
               Left = 38
               Bottom = 84
               Right = 196
            End
            DisplayFlags = 280
            TopColumn = 0
         End
      End
   End
   Begin SQLPane = 
   End
   Begin DataPane = 
      Begin ParameterDefaults = ""
      End
   End
   Begin CriteriaPane = 
      Begin ColumnWidths = 11
         Column = 1440
         Alias = 900
         Table = 1170
         Output = 720
         Append = 1400
         NewValue = 1170
         SortType = 1350
         SortOrder = 1410
         GroupBy = 1350
         Filter = 1350
         Or = 1350
         Or = 1350
         Or = 1350
      End
   End
End
', 'SCHEMA', 'dbo', 'VIEW', 'v_selFam'
GO

EXEC sp_addextendedproperty 'MS_DiagramPaneCount', 1, 'SCHEMA', 'dbo', 'VIEW', 'v_selFam'
GO

COMMIT
GO





-- update stored
SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

/*************************************
* STORED PROCEDURE sp_insRichiesta
* 	Inserisce nuova richiesta di intervento
*
* modif.:	S.E.L. - 2009.02.20
**************************************/
ALTER PROCEDURE sp_insRichiesta
(
	@richiesta DATETIME,
	@dataLav DATETIME,
	@turnoLav INT,
	@matr VARCHAR(10),
	@guasto DATETIME,
	@idxAmbito INT,
	@idxPriorita INT,
	@isFermo BIT,
	@idxTipo INT,
	@idxImpianto INT,
	@idxMacchina INT,
	@descrizione VARCHAR(500),
	@idxCausale INT,
	@numIntMtz INT output
)
AS

BEGIN TRAN

	INSERT INTO InterventiMtz
	                      (richiesta, dataLav, turnoLav, matr, guasto, idxAmbito, idxPriorita, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxStato, idxCausale)
	VALUES     (@richiesta,@dataLav,@turnoLav,@matr,@guasto,@idxAmbito,@idxPriorita,@isFermo,@idxTipo,@idxImpianto,@idxMacchina,@descrizione, 1,@idxCausale)
	
	/*************************************
	* salvo idx del nuovo record
	**************************************/
	SET @numIntMtz = SCOPE_IDENTITY() 
	
COMMIT TRAN

RETURN (@numIntMtz)
GO

COMMIT
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET ANSI_NULLS ON
GO

/*************************************
* STORED PROCEDURE sp_updateInterventoFull
* 	aggiorna TUTTI i dati dell'intervento
*
* modif.:	S.E.L. - 2009.02.20
**************************************/
ALTER PROCEDURE sp_updateInterventoFull
(
	@Original_numIntMtz INT,
	@idxStato INT,
	@inizioIntervento DATETIME,
	@fineIntervento DATETIME,
	@isPreventivabile BIT,
	@descrizioneIntervento VARCHAR(500),
	@matr VARCHAR(50),
	@guasto DATETIME,
	@isFermo BIT,
	@idxImpianto INT,
	@idxMacchina INT,
	@idxAmbito INT,
	@idxPriorita INT,
	@descrizione VARCHAR(500),
	@idxTipo INT,
	@idxCausale INT,
	@presaInCarico DATETIME
)
AS

UPDATE    InterventiMtz
SET              inizioIntervento = @inizioIntervento, fineIntervento = @fineIntervento, descrizioneIntervento = @descrizioneIntervento, isPreventivabile = @isPreventivabile, 
                      idxStato = @idxStato, matr = @matr, guasto = @guasto, idxAmbito = @idxAmbito, idxPriorita = @idxPriorita, isFermo = @isFermo, idxTipo = @idxTipo, 
                      idxImpianto = @idxImpianto, idxMacchina = @idxMacchina, descrizione = @descrizione, presaInCarico = @presaInCarico, idxCausale = @idxCausale
WHERE     (numIntMtz = @Original_numIntMtz)

RETURN
GO

COMMIT
GO





-- update valori
SET xact_abort ON
GO

BEGIN TRANSACTION
GO

UPDATE dbo.AnagAmbitoGuasto SET 
  descrAmbitoGuasto=N'errore programma CN'
  WHERE idxAmbito=8
GO

COMMIT TRANSACTION
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET IDENTITY_INSERT dbo.AnagFamMacchine ON
GO

UPDATE dbo.AnagFamMacchine SET 
  nomeFamMacch=N'Tutte'
  WHERE idxFamMacchine=1
UPDATE dbo.AnagFamMacchine SET 
  nomeFamMacch=N'Paranchi'
  WHERE idxFamMacchine=3
UPDATE dbo.AnagFamMacchine SET 
  nomeFamMacch=N'Rettifiche'
  WHERE idxFamMacchine=4
UPDATE dbo.AnagFamMacchine SET 
  nomeFamMacch=N'Banchetti'
  WHERE idxFamMacchine=5
UPDATE dbo.AnagFamMacchine SET 
  nomeFamMacch=N'Rulliere'
  WHERE idxFamMacchine=6
UPDATE dbo.AnagFamMacchine SET 
  nomeFamMacch=N'Robot'
  WHERE idxFamMacchine=7
INSERT INTO dbo.AnagFamMacchine
  (idxFamMacchine, nomeFamMacch)
  VALUES (8, N'Segatrici')
INSERT INTO dbo.AnagFamMacchine
  (idxFamMacchine, nomeFamMacch)
  VALUES (9, N'Tornitrici')
GO

SET IDENTITY_INSERT dbo.AnagFamMacchine OFF
GO

COMMIT TRANSACTION
GO


SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET IDENTITY_INSERT dbo.AnagCausali ON
GO

INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (1, 1, N'N.D.', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (2, 8, N'CATENA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (3, 8, N'MOTORE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (4, 4, N'ATTREZZATURA DI BLOCCAGGIO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (5, 4, N'ASSI LINEARI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (6, 5, N'ASSI LINEARI O CIRCOLARE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (7, 6, N'PASSO-PASSO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (8, 1, N'IMPIANTO IDRAULICO E LUBRIFICAZIONE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (9, 1, N'CONTROLLO NUMERICO, AZIONAMENTO O PLC', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (10, 1, N'EVACUATORE TRUCIOLI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (11, 1, N'IMPIANTO LUBROREFRIGERANTE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (12, 1, N'SENSORI-FINECORSA-FOTOCELLULE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (13, 1, N'RULLIERE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (14, 1, N'PORTE E RIPARI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (15, 1, N'IMPIANTO PNEUMATICO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (16, 1, N'POMPE E MOTORI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (17, 1, N'LAMPADE DI LAVORO O SEGNALAZIONE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (18, 1, N'ERRATA PROGRAMMAZIONE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (19, 1, N'PULIZIA GENERALE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (20, 2, N'TAVOLA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (21, 2, N'CAMBIO UTENSILE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (22, 2, N'ATTREZZATURA DI BLOCCAGGIO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (23, 2, N'LINEA MANDRINO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (24, 2, N'ASSI LINEARI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (25, 2, N'MONITOR', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (26, 2, N'CINGHIE O INGRANAGGI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (27, 9, N'TORRETTA PORTAUTENSILI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (28, 9, N'ATTREZZATURA DI BLOCCAGGIO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (29, 9, N'LINEA MANDRINO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (30, 9, N'ASSI LINEARI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (31, 9, N'MANIPOLATORI (GUPO)-MAGNETI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (32, 9, N'MONITOR', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (33, 9, N'CINGHIA E INGRANAGGI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (34, 9, N'ASPIRATORE-CONDIZIONATORE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (35, 7, N'ELETTROMAGNETI E PINZA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (36, 7, N'ECCESSIVO GIOCO ASSI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (37, 7, N'CAVO SPIRALATO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (38, 7, N'SCHEDA ELETTRONICA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (39, 7, N'MOTORE ASSI 1-6', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (40, 7, N'MONITOR O TASTIERA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (41, 7, N'INGRANAGGI O POLSO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (42, 4, N'CONTROPUNTA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (43, 4, N'PORTAPEZZO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (44, 4, N'MOLE E DIAMANTI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (45, 4, N'MONITOR', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (46, 4, N'CARICATORE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (47, 4, N'CINGHIA E INGRANAGGI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (48, 5, N'MONITOR', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (49, 5, N'CINGHIA', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (50, 6, N'RULLI', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (51, 6, N'CATENE', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (52, 6, N'CENTRAGGIO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (53, 3, N'ATTREZZATURE DI BLOCCAGGIO', 1)
INSERT INTO dbo.AnagCausali
  (idxCausale, idxFamMacchine, descrCausale, attiva)
  VALUES (54, 3, N'GANCIO-CATENA-CORDA ACCIAIO', 1)
GO

SET IDENTITY_INSERT dbo.AnagCausali OFF
GO

COMMIT TRANSACTION
GO


SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET IDENTITY_INSERT dbo.AnagImpianti ON
GO

UPDATE dbo.AnagImpianti SET 
  nomeImpianto=N'MANUTENZIONE'
  WHERE idxImpianto=1
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'35', nomeImpianto=N'QUALITA'' (35)'
  WHERE idxImpianto=2
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'04', nomeImpianto=N'TORNITURA (04)'
  WHERE idxImpianto=3
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'11', nomeImpianto=N'DENTATURA (11)'
  WHERE idxImpianto=4
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'12', nomeImpianto=N'GLEASON (12)'
  WHERE idxImpianto=5
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'20', nomeImpianto=N'AFFILATURA (20)'
  WHERE idxImpianto=6
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'01', nomeImpianto=N'SEGHETTI (01)'
  WHERE idxImpianto=7
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'05', nomeImpianto=N'TRAPANI (05)'
  WHERE idxImpianto=8
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'07', nomeImpianto=N'SBAVATURA (07)'
  WHERE idxImpianto=9
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'15', nomeImpianto=N'RETTIFICHE SCANALATI (15)'
  WHERE idxImpianto=10
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'14', nomeImpianto=N'RETTIFICHE ESTERNE (14)'
  WHERE idxImpianto=11
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'08', nomeImpianto=N'FRESATURA (08)'
  WHERE idxImpianto=12
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'19', nomeImpianto=N'RETTIFICHE DENTI (19)'
  WHERE idxImpianto=13
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'17', nomeImpianto=N'SERVIZI PER RETTIFICHE (17)'
  WHERE idxImpianto=14
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'16', nomeImpianto=N'RETTIFICHE FILETTI (16)', tipoImpianto=N'Reparto'
  WHERE idxImpianto=15
UPDATE dbo.AnagImpianti SET 
  codImpianto=N'18', nomeImpianto=N'RETTIFICHE INTERNE (18)', tipoImpianto=N'Reparto'
  WHERE idxImpianto=16
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (17, N'06', N'BROCCIATURA (06)', N'Reparto', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (18, N'10', N'LAVORAZIONI AL BANCO (10)', N'Reparto', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (19, N'25', N'LAVATRICI (25)', N'Reparto', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (20, N'21', N'UNIVERSALE (21)', N'Reparto', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (21, N'OBSO', N'OBSOLETE (TRESCORE 2)', N'VIRTUALE', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (22, N'09', N'ARROTONDATRICI (09)', N'Reparto', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (23, N'ENTR', N'ENTRATICO', N'Reparto', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
INSERT INTO dbo.AnagImpianti
  (idxImpianto, codImpianto, nomeImpianto, tipoImpianto, funzDal, funzAl)
  VALUES (24, N'45', N'UFFICI/SERVIZI (45)', N'VIRTUALE', '1900-01-01 00:00:00.000', '2100-12-31 00:00:00.000')
GO

SET IDENTITY_INSERT dbo.AnagImpianti OFF
GO

COMMIT TRANSACTION
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

SET IDENTITY_INSERT dbo.AnagMacchine ON
GO

INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (425, 7, N'--SE/1', N'Segatrice a nastro', N'DAITO GA 260 W', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (426, 7, N'--SE/2', N'Segatrice a nastro', N'DAITO GA 260 W', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (427, 3, N'---LP1', N'ISOLA TORNITURA+DENTATURA+SBAVATURA', N'MAZAK+SAMP+GLEASON', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (428, 13, N'--EM/7', N'Tornio verticale CN      con caricatore', N'EMAG VSC 7', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (429, 3, N'--DT20', N'Tornio a 2 teste CN  con portale (isola LP1)', N'MAZAK DT20', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (430, 13, N'EM3152', N'Tornio verticale CN      con caricatore', N'EMAG VSC 315', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (431, 13, N'-EM400', N'Tornio verticale CN      con caricatore', N'EMAG VSC 400', N'-', 1999, 1, 1, '1999-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (432, 3, N'MT5003', N'Tornio CN      con portale', N'GRAZIANO MT500 CNC', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (433, 13, N'-EM315', N'Tornio verticale CN      con caricatore', N'EMAG VSC 315', N'-', 1997, 1, 1, '1997-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (434, 3, N'---PDF', N'Tornio frontale a 2 teste CN', N'PITTLER 200 CNC PDF', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (435, 3, N'MT5002', N'Tornio CN      con portale', N'GRAZIANO MT500 CNC', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (436, 3, N'-MT500', N'Tornio CN      con portale', N'GRAZIANO MT500 CNC', N'-', 1994, 1, 1, '1994-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (437, 3, N'--P200', N'Tornio frontale a 2 teste CN      con robot', N'PITTLER 200 CNC PETRA 1', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (438, 3, N'-OK165', N'Tornio frontale a 2 teste CN', N'OKUMA 165 CNC', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (439, 3, N'--P315', N'Tornio frontale a 2 teste CN', N'PITTLER 315 CNC PETRA 2', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (440, 3, N'--P250', N'Tornio frontale a 2 teste CN      con robot', N'PITTLER 250 CNC PETRA 1', N'-', 1987, 1, 1, '1987-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (441, 3, N'--TP/1', N'Tornio parallelo', N'CMT URSUS 225', N'-', 1980, 1, 1, '1980-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (442, 3, N'--TP/2', N'Tornio parallelo', N'CMT URSUS 225', N'-', 1985, 1, 1, '1985-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (443, 13, N'-FZ350', N'Tornio verticale CN a 2 teste      con caricatore', N'TORNIO FELSOMAT FZ350', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (444, 8, N'-TMB/1', N'Trapano multiplo', N'BERARDI VB II Z', N'-', 1980, 1, 1, '1980-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (445, 8, N'-TMB/2', N'Trapano multiplo', N'BERARDI VB II Z', N'-', 1980, 1, 1, '1980-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (446, 8, N'---TMO', N'Trapano multiplo', N'OLIVETTI', N'-', 1978, 1, 1, '1978-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (447, 8, N'----TO', N'Trapano', N'OLIVETTI', N'-', 1975, 1, 1, '1975-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (448, 8, N'---MCX', N'Trapano', N'SERRMAC', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (449, 8, N'RECORD', N'Maschiatrice', N'RECORD', N'-', 1993, 1, 1, '1993-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (450, 8, N'---MJN', N'Maschiatrice', N'JOANNES', N'-', 1978, 1, 1, '1978-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (451, 17, N'--BV25', N'Brocciatrice', N'VARINELLI 25 TON', N'-', 1981, 1, 1, '1981-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (452, 17, N'--BVM6', N'Brocciatrice', N'VARINELLI 6 TON', N'-', 1980, 1, 1, '1980-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (453, 9, N'--GR/5', N'Sbavatrice GR/5', N'MPM SAG50/PN', N'-', 1978, 1, 1, '1978-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (454, 9, N'--GR/4', N'Sbavatrice GR/4', N'MINITOOLS MT600', N'-', 1990, 1, 1, '1990-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (455, 9, N'--GR/7', N'Smussatrice GR/7', N'RAVAGLIA', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (456, 9, N'--GR/8', N'Smussatrice GR/8', N'RAVAGLIA', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (457, 9, N'--GR/3', N'Sbavatrice GR/3', N'MPM', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (458, 3, N'no ID (isola LP1)', N'Sbavatrice (in Isola LP1)', N'SAMPUTENSILI ', N'-', 2004, 1, 1, '2004-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (459, 9, N'---SCT', N'Sbavatrice', N'SAMPUTENSILI SCT3', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (460, 9, N'-SCT/2', N'Sbavatrice', N'SAMPUTENSILI SCT3', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (461, 9, N'--GR/1', N'Sbavatrice GR/1', N'GRATOMAT KGG533', N'-', 1979, 1, 1, '1979-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (462, 9, N'--GR/2', N'Sbavatrice GR/2', N'GRATOMAT 300L', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (463, 12, N'-V5005', N'Centro di lavoro CN', N'DOOSAN VC500', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (464, 12, N'-V5004', N'Centro di lavoro CN', N'DOOSAN VC500', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (465, 12, N'--V500', N'Centro di lavoro CN', N'DAEWOO ACE VC500', N'-', 2000, 1, 1, '2000-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (466, 12, N'-V5002', N'Centro di lavoro CN', N'DAEWOO ACE VC500', N'-', 2001, 1, 1, '2001-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (467, 12, N'-V5003', N'Centro di lavoro CN', N'DAEWOO ACE VC500', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (468, 12, N'--V400', N'Centro di lavoro CN', N'DAEWOO ACE V400', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (469, 12, N'----MK', N'Fresatrice CN', N'MIKRON WF 31 CNC', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (470, 12, N'--V650', N'Centro di lavoro CN', N'DOOSAN MYNX 650', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (471, 3, N'-GP20A', N'Dentatrice a creatore CN     con caricatore (isola LP1)', N'GLEASON PFAUTER GP 200', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (472, 4, N'P180/1', N'Dentatrice a creatore CN     con caricatore', N'PFAUTER PA 180 CNC', N'-', 2001, 1, 1, '2001-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (473, 4, N'P300/1', N'Dentatrice a creatore CN     con caricatore', N'PFAUTER PE 300 CNC', N'-', 1997, 1, 1, '1997-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (474, 4, N'P250/1', N'Dentatrice a creatore CN     con caricatore', N'PFAUTER PE 250 CNC', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (475, 4, N'H280C1', N'Dentatrice a creatore CN     con caricatore', N'HURTH WF 280', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (476, 4, N'H280/1', N'Dentatrice a creatore', N'HURTH WF 280', N'-', 1983, 1, 1, '1983-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (477, 4, N'P160/1', N'Dentatrice a creatore CNC', N'PFAUTER P160 H/11', N'-', 1990, 1, 1, '1990-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (478, 4, N'P160H1', N'Dentatrice a creatore', N'PFAUTER P160 H/11', N'-', 1983, 1, 1, '1983-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (479, 4, N'P403/1', N'Dentatrice a creatore', N'PFAUTER P403', N'-', 1983, 1, 1, '1983-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (480, 4, N'P630/1', N'Dentatrice a creatore CNC', N'PFAUTER P630', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (481, 4, N'P400/1', N'Dentatrice a creatore', N'PFAUTER P400', N'-', 1972, 1, 1, '1972-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (482, 4, N'--LS/2', N'Dentatrice a stozzare          con robot', N'LORENZ LS 200', N'-', 2001, 1, 1, '2001-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (483, 4, N'-SNJ/3', N'Dentatrice a stozzare', N'LORENZ SNJ 5 AUTO', N'-', 2001, 1, 1, '2001-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (484, 4, N'--LS/1', N'Dentatrice a stozzare', N'LORENZ LS 302', N'-', 1986, 1, 1, '1986-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (485, 21, N'-SN4/2', N'Dentatrice a stozzare', N'LORENZ SN 4', N'-', 1969, 1, 1, '1969-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (486, 4, N'-SNJ/1', N'Dentatrice a stozzare', N'LORENZ SNJ 5', N'-', 1962, 1, 1, '1962-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (487, 21, N'-SNJ/2', N'Dentatrice a stozzare', N'LORENZ SNJ 5', N'-', 1962, 1, 1, '1962-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (488, 13, N'---LP2', N'ISOLA RETTIFICA E LAPPATURA', N'MORARA+STUDER', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (489, 13, N'STU1/1', N'Rettifica per esterni CN      con caricatore (isola LP2)', N'STUDER ECO 1000', N'-', 2003, 1, 1, '2003-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (490, 11, N'K175/1', N'Rettifica per esterni CN', N'KELLENBERGER R 175 CN', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (491, 11, N'K175/2', N'Rettifica per esterni CN', N'KELLENBERGER R 175 CN', N'-', 1994, 1, 1, '1994-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (492, 11, N'--K125', N'Rettifica per esterni', N'KELLENBERGER R 125', N'-', 1987, 1, 1, '1987-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (493, 11, N'TA1018', N'Rettifica per esterni', N'TACCHELLA UM 1018', N'-', 1986, 1, 1, '1986-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (494, 11, N'-TA612', N'Rettifica per esterni', N'TACCHELLA UN 612', N'-', 1986, 1, 1, '1986-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (495, 10, N'-RE12K', N'Rettifica per alberi scanalati CN', N'F.W. REFORM KSA 1200 CN', N'-', 1990, 1, 1, '1990-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (496, 6, N'--RIT4', N'Affilatrice/Rettifica per innesti', N'TACCHELLA 4 AM', N'-', 1986, 1, 1, '1986-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (497, 11, N'----FV', N'Rettifica piani a tavola rotante', N'FAVRETTO MR 75 CN', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (498, 14, N'----RC', N'Rettifica centri', N'TECHNICA ZSM 6-5100-810', N'-', 1994, 1, 1, '1994-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (499, 15, N'no ID', N'Rettifica filetti', N'REISHAUER US', N'-', 1981, 1, 1, '1981-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (500, 15, N'-RFMSO', N'Rettifica filetti', N'MSO GA-2', N'-', 1979, 1, 1, '1979-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (501, 15, N'no ID', N'Affilatrice per creatori rettifica filetti', N'REISHAUER US', N'-', 1981, 1, 1, '1981-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (502, 16, N'--VM40', N'Rettifica per interni CN', N'VOUMARD 403 Y CN', N'-', 2003, 1, 1, '2003-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (503, 16, N'--VM15', N'Rettifica per interni CN', N'VOUMARD 150 CNC', N'-', 2002, 1, 1, '2002-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (504, 16, N'--VM5N', N'Rettifica per interni CN', N'VOUMARD 5N CN', N'-', 1999, 1, 1, '1999-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (505, 16, N'-MRE44', N'Rettifica per interni CN', N'MORARA 700 CN', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (506, 16, N'--MRIE', N'Rettifica per interni CN', N'MORARA MICRO I-E CN', N'-', 1987, 1, 1, '1987-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (507, 16, N'-VM5/1', N'Rettifica per interni', N'VOUMARD 5A', N'-', 1978, 1, 1, '1978-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (508, 16, N'-VM5/2', N'Rettifica per interni', N'VOUMARD 5A', N'-', 1979, 1, 1, '1979-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (509, 16, N'-VM5/3', N'Rettifica per interni', N'VOUMARD 5A', N'-', 1980, 1, 1, '1980-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (510, 16, N'-IC2MC', N'Rettifica per interni CN (in isola LP2)', N'MORARA I/C 2M', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (511, 16, N'--SN/2', N'Lappatrice (in isola LP2)', N'SUNNEN ML-2000', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (512, 16, N'----SN', N'Lappatrice', N'SUNNEN MBB1680A', N'-', 1983, 1, 1, '1983-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (513, 13, N'-RZ400', N'Rettifica denti CN      con robot', N'REISHAUER RZ 400', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (514, 13, N'RZ4002', N'Rettifica denti CN      con robot', N'REISHAUER RZ 400', N'-', 2006, 1, 1, '2006-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (515, 13, N'RZ4003', N'Rettifica denti CN      con robot', N'REISHAUER RZ 400', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (516, 13, N'-RZ150', N'Rettifica denti CN      con robot', N'REISHAUER RZ 150', N'-', 2003, 1, 1, '2003-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (517, 13, N'-RZ362', N'Rettifica denti CN ', N'REISHAUER RZ 362 A', N'-', 1997, 1, 1, '1997-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (518, 13, N'RZ362C', N'Rettifica denti CN ', N'REISHAUER RZ 362 A', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (519, 13, N'RZ362P', N'Rettifica denti CN ', N'REISHAUER RZ 362 A', N'-', 2000, 1, 1, '2000-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (520, 13, N'--RZ/2', N'Rettifica denti elettronica', N'REISHAUER RZ 300 E', N'-', 1996, 1, 1, '1996-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (521, 13, N'-RZ820', N'Rettifica denti CN', N'REISHAUER RZ 820 CN', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (522, 13, N'--RZAS', N'Rettifica denti CN', N'REISHAUER RZ 301 AS CN', N'-', 1994, 1, 1, '1994-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (523, 13, N'---RZS', N'Rettifica denti CN', N'REISHAUER RZ 301 S CN', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (524, 13, N'----ZB', N'Rettifica denti', N'REISHAUER ZB', N'-', 1979, 1, 1, '1979-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (525, 18, N'-H20BU', N'Bilanciatrice CN', N'SCHENCK H280BU', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (526, 19, N'no ID', N'Lavatrice', N'CEMASTIR TURBO LC1000', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (527, 19, N'no ID', N'Lavatrice (in RZ150)', N'TECNOFIRMA', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (528, 19, N'no ID', N'Lavatrice (in RZ400)', N'CP3', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (529, 19, N'nd', N'Lavatrice (dentatura - su H280C)', N'', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (530, 19, N'nd', N'Lavatrice (dentatura - su P250/P300)', N'', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (531, 14, N'----GB', N'Raddrizzatrice', N'GALDABINI RPRS/25', N'-', 1970, 1, 1, '1970-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (532, 14, N'no ID', N'Diamantatrici per mole', N'REISHAUER AM10', N'-', 1987, 1, 1, '1987-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (533, 14, N'no ID', N'Diamantatrici per mole', N'REISHAUER AM10', N'-', 1987, 1, 1, '1987-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (534, 14, N'no ID', N'Bilanciatrice per mole', N'HOFFMAN', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (535, 18, N'--PR/1', N'Pressa cecatura fase', N'SOMASCHINI', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (536, 18, N'--PR/2', N'Macchina piantaggio spine Mercedes  Z92', N'NUOVA VAEP MA0079', N'-', 2006, 1, 1, '2006-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (537, 18, N'--PR/3', N'Macchina piantaggio spine Mercedes Z46', N'SOMASCHINI', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (538, 18, N'---STR', N'Punzonatrice a rullare', N'SOMAUT-AUTOMATOR', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (539, 18, N'--ST/1', N'Punzonatrice', N'AUTOMATOR 35/S', N'-', 2004, 1, 1, '2004-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (540, 18, N'--ST/2', N'Punzonatrice', N'AUTOMATOR MB35', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (541, 18, N'--PRCM', N'Pressa', N'CMP T150', N'-', 1999, 1, 1, '1999-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (542, 18, N'----PR', N'Pressa', N'OMCN 161/R T40', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (543, 18, N'---BA3', N'BANCO ASSEMBLAGGIO TRIPLO MERCEDES', N'SOMASCHINI', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (544, 18, N'no ID', N'BANCO LAVORO', N'SOMASCHINI', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (545, 18, N'no ID', N'SPAZZOLATRICE', N'ACETI MACCHINE 9532', N'-', 2006, 1, 1, '2006-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (546, 18, N'no ID', N'MARCATRICE', N'RR AXTRON T2000', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (547, 18, N'no ID', N'FORNO INVECCHIAMENTO', N'INOX2', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (548, 18, N'no ID', N'CELLA FRIGO', N'LINDE 77/73', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (549, 6, N'no ID', N'KLINGELNBERG TF1584', N'KLINGELNBERG TF1584', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (550, 6, N'no ID', N'AFFILATRICE', N'CUOGHI', N'-', 1992, 1, 1, '1992-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (551, 6, N'-RSWK3', N'AFFILATRICE', N'SCHUTTE WU3', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (552, 6, N'no ID', N'CINCINNATI OM', N'CINCINNATI OM', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (553, 6, N'no ID', N'ZOCCA RPV650', N'ZOCCA RPV650', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (554, 20, N'nd', N'MACCHINA UNIVERSALE', N'', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (555, 23, N'-L502A', N'Dentatrice a creatore', N'LIEBHERR LC 502 CNC', N'-', 2005, 1, 1, '2005-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (556, 23, N'nd', N'DENTATRICE A CREATORE', N'GLEASON PFAUTER GP200CN', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (557, 23, N'no ID', N'PRESSA', N'OMCN 161/R 40 TON', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (558, 23, N'no ID', N'MARCATRICE', N'RR AXTRON T2000', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (559, 23, N'--MW1A + --MW2A', N'TORNIO (LINEA A-BIANCO)', N'MURATEC MW200-1', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (560, 23, N'-LC30A', N'DENTATRICE A CREATORE (LINEA A-BIANCO)', N'LIEBHERR LC180', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (561, 23, N'-S250A', N'SBAVATRICE (LINEA A-BIANCO)', N'SAMPUTENSILI S250CD', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (562, 23, N'--MW1B + --MW2B', N'TORNIO (LINEA B-BIANCO)', N'MURATEC MW200-1', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (563, 23, N'-LC30B', N'DENTATRICE A CREATORE (LINEA B-BIANCO)', N'LIEBHERR LC300', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (564, 23, N'-S250B', N'SBAVATRICE (LINEA B-BIANCO)', N'SAMPUTENSILI S250CD', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (565, 23, N'--HX30', N'CENTRO DI LAVORO CN', N'KITAMURA HX300IF', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (566, 23, N'---BRE', N'BROCCIATRICE', N'MANACA', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (567, 23, N'-VSC1A + -VSC2A', N'TORNIO (LINEA A-DOPO T.T.)', N'EMAG VSC315', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (568, 23, N'-R303A', N'RETTIFICA DENTI (LINEA A-DOPO T.T.)', N'REISHAUER RZ303C', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (569, 23, N'no ID', N'LAVATRICE (LINEA A-DOPO T.T.)', N'TECNOFIRMA SAT-LIN', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (570, 23, N'-VSC1B + -VSC2B', N'TORNIO (LINEA B-DOPO T.T.)', N'EMAG VSC315', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (571, 23, N'-R303B', N'RETTIFICA DENTI (LINEA B-DOPO T.T.)', N'REISHAUER RZ303C', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (572, 23, N'no ID', N'LAVATRICE (LINEA B-DOPO T.T.)', N'TECNOFIRMA SAT-LIN', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (573, 23, N'--ASDU', N'CELLA SIR PER MONTAGGIO DUPLO', N'SIR 2062R1', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (574, 23, N'nd', N'PRESSA ASSEMBLAGGIO DUPLO (FASE 10)', N'SIR', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (575, 23, N'no ID', N'FORNO A INDUZIONE (FASE 10)', N'ATE-IFC 15/2', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (576, 23, N'no ID', N'VASCA DI RAFFREDDAMENTO (FASE 10)', N'CEEVER AGITO', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (577, 23, N'-CESP', N'CENTRO DI LAVORO CN (FASE 20-SPINATURA)', N'DAEWOO VC500', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (578, 23, N'--ASBU', N'CELLA SIR PER ASSEMBLAGGIO BUSSOLA', N'SIR 2062R2', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (579, 23, N'--VSCM', N'TORNIO (FASE 30)', N'EMAG VSC315', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (580, 23, N'nd', N'PRESSA ASSEMBLAGGIO BUSSOLA (FASE 40) + MARPOSS', N'SIR', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (581, 23, N'no ID', N'LAVATRICE (FASE 60)', N'TECNOFIRMA SAT 3-10', N'-', 2007, 1, 1, '2007-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (582, 21, N'non necessario', N'Tornio CN', N'CASTOR FNC 45 CNC', N'-', 1986, 1, 1, '1986-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (583, 21, N'non necessario', N'Trapano', N'AUDAX', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (584, 21, N'non necessario', N'Trapano multiplo', N'BERARDI VBM II', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (585, 21, N'non necessario', N'Trapano a colonna', N'CABER', N'-', 1972, 1, 1, '1972-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (586, 21, N'non necessario', N'Trapano multiplo', N'FAMUP', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (587, 21, N'non necessario', N'Sbavatrice      2 teste', N'TECNOMACCHINE TM 200', N'-', 2003, 1, 1, '2003-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (588, 21, N'non necessario', N'Fresatrice CN', N'RIVA CNC', N'-', 1985, 1, 1, '1985-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (589, 21, N'non necessario', N'Rasatrice', N'HURTH ZSA 320', N'-', 1984, 1, 1, '1984-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (590, 21, N'non necessario', N'Rettifica per esterni CN      con caricatore', N'MORARA EA 700 CN', N'-', 1996, 1, 1, '1996-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (591, 21, N'non necessario', N'Rettifica per interni', N'VOUMARD 251 L6 / 550', N'-', 1979, 1, 1, '1979-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (592, 21, N'non necessario', N'Rettifica per alberi scanalati CN', N'F.W. REFORM SK12A CN', N'-', 1985, 1, 1, '1985-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (593, 21, N'non necessario', N'Rettifica filetti', N'REISHAUER G4-I', N'-', 1974, 1, 1, '1974-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (594, 21, N'non necessario', N'Rettifica per interni', N'WOTAN RJ 133', N'-', 1977, 1, 1, '1977-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (595, 21, N'non necessario', N'Rettifica denti elettronica', N'REISHAUER RZ 300 E', N'-', 1988, 1, 1, '1988-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (596, 21, N'non necessario', N'Rettifica denti', N'REISHAUER AZA', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (597, 21, N'non necessario', N'Lappatrice per ingranaggi', N'FÄSSLER D-250', N'-', 1993, 1, 1, '1993-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (598, 21, N'non necessario', N'Rettifica per esterni', N'MSO FH 300x500', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (599, 21, N'non necessario', N'Dentatrice a creatore', N'PFAUTER RS9 KS', N'-', 1972, 1, 1, '1972-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (600, 22, N'--PK15', N'Arrotondatrice per dentature', N'PICCO K15', N'-', 1980, 1, 1, '1980-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (601, 5, N'G175/7 + G175/8', N'Dentatrice conica spirale CN', N'GLEASON G175 CNC PHOENIX', N'-', 2006, 1, 1, '2006-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (602, 5, N'G116', N'Dentatrice conica spirale CN', N'GLEASON 116 CNC', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (603, 5, N'G106/2', N'Dentatrice conica spirale', N'GLEASON 106', N'-', 1989, 1, 1, '1989-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (604, 5, N'G106/1', N'Dentatrice conica spirale', N'GLEASON 106 REMAUT CNC', N'-', 2008, 1, 1, '2008-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (605, 5, N'RD503', N'Lappatrice per coppie coniche Gleason', N'GLEASON LAPPER 503', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (606, 5, N'RD/1+RD/2', N'Lappatrice per coppie coniche Gleason', N'GLEASON LAPPER 119 HYPOID', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (607, 5, N'CRD5 4', N'Tester di controllo coppie coniche Gleason', N'TESTER 5" (REVISIONATO 2008)', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (608, 5, N'CRD6 1/2/3/5', N'Tester di controllo coppie coniche Gleason', N'TESTER 6"', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (609, 5, N'CRD17A 1/2/3/5/7/8', N'Tester di controllo coppie coniche Gleason', N'TESTER 17A', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (610, 5, N'CRD502 4/6', N'Tester di controllo coppie coniche Gleason', N'TESTER 502', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (611, 5, N'CRD13', N'Tester di controllo coppie coniche Gleason', N'TESTER 13', N'-', 1985, 1, 1, '1985-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (612, 11, N'---MSO', N'Rettifica per esterni', N'MSO FH 300x500', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (613, 7, N'----IC', N'Intestatrice Centratrice', N'MACHINTEST M25/M35T', N'-', 1990, 1, 1, '1990-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (614, 2, N'nd', N'Centro CN di misurazione 3D', N'ZEISS PRISMO 9/12/7', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (615, 2, N'nd', N'Centro CN di misurazione ingr.', N'HÖFLER ZP 630 CN', N'-', 1996, 1, 1, '1996-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (616, 2, N'nd', N'Centro CN di misurazione ingr.', N'HÖFLER EMZ 632 CN', N'-', 1990, 1, 1, '1990-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (617, 2, N'nd', N'Ingranometro', N'HÖFLER ZW630 CN', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (618, 2, N'nd', N'Macchina prova rumorosità', N'HURTH ZP 300', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (619, 2, N'nd', N'Rugosimetro', N'PERTHEN S5P', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (620, 2, N'nd', N'Durometro', N'WOLPERT DIA-TESTOR 1551', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (621, 2, N'nd', N'Durometro', N'REICHERTER', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (622, 2, N'nd', N'Durometro', N'GALILEO', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (623, 2, N'nd', N'Proiettore di profili', N'HAUSER', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (624, 2, N'nd', N'Apparecchio altimetro digitale con controp.', N'DIGIMAR 817C', N'-', 1990, 1, 1, '1990-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (625, 2, N'nd', N'Interassimetro', N'PARKSON', N'-', 1900, 1, 1, '1900-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (626, 2, N'nd', N'Apparecchio controllo conicita'' pneum./elettr.', N'STOTZ DLS-27', N'-', 1996, 1, 1, '1996-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (627, 2, N'nd', N'Appararecchio controllo strumenti di misura', N'JOINT DMS 680', N'-', 1995, 1, 1, '1995-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (628, 2, N'nd', N'Profilometro', N'MAHR - PERTHOMETER PRK', N'-', 1997, 1, 1, '1997-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (629, 2, N'nd', N'Appararecchio prova bruciature', N'ROLLSCAN 200-1', N'-', 1997, 1, 1, '1997-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (630, 2, N'nd', N'Apparecchio per coni', N'STOTZ - DLS 27 M1 (4 elementi)', N'-', 1997, 1, 1, '1997-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (631, 2, N'nd', N'Altimetro', N'TESA - MICROHITE', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (632, 2, N'nd', N'Troncatrice', N'IMPTECH - C 10', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (633, 2, N'nd', N'Inglobatrice', N'BUEHLER - SIMPLIMET 2000', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (634, 2, N'nd', N'Levigatrice', N'BUEHLER - METASERV 2000', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (635, 2, N'nd', N'Microdurometro', N'FUTURE TECH - FM-7', N'-', 1998, 1, 1, '1998-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (636, 2, N'---MGX', N'MAGNETOSCOPIO', N'MAGNISCOP CGM CEMSAFOS 1000', N'-', 2000, 1, 1, '2000-01-01 12:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (638, 1, N'0000', N'-- [NUOVA] Nome Macchina non definito --', N'modello n.d.', N'', 2009, 0, 0, '2009-03-10 00:00:00.000', '2019-03-10 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (645, 1, N'0000', N'-- [NUOVA] Nome Macchina non definito --', N'modello n.d.', N'', 2009, 0, 0, '2009-03-10 00:00:00.000', '2019-03-10 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (647, 24, N'TM', N'UFFICIO TEMPI E METODI', N'ND', NULL, 2009, 0, 0, '2009-03-10 00:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (648, 24, N'UT', N'UFFICIO TECNICO', N'ND', NULL, 2009, 0, 0, '2009-03-10 00:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (649, 24, N'PRG', N'UFFICIO PROGRAMMAZIONE', N'ND', NULL, 2009, 0, 0, '2009-03-10 00:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (650, 24, N'ACQ', N'UFFICIO ACQUISTI', N'ND', NULL, 2009, 0, 0, '2009-03-10 00:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (651, 24, N'COM', N'UFFICIO COMMERCIALE', N'ND', NULL, 2009, 0, 0, '2009-03-10 00:00:00.000', '2100-01-01 00:00:00.000')
INSERT INTO dbo.AnagMacchine
  (idxMacchina, idxImpianto, codMacchina, nomeMacchina, modello, matricola, anno, kgPeso, kwConsumo, funzDal, funzAl)
  VALUES (652, 24, N'DIR', N'DIREZIONE', N'ND', NULL, 2009, 0, 0, '2009-03-10 00:00:00.000', '2100-01-01 00:00:00.000')

DELETE FROM dbo.AnagMacchine WHERE idxMacchina=3
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=4
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=5
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=6
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=7
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=8
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=9
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=10
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=11
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=12
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=13
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=14
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=15
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=16
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=17
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=18
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=19
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=20
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=21
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=22
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=23
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=24
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=25
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=26
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=27
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=28
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=29
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=30
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=31
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=32
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=33
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=34
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=35
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=36
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=37
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=38
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=39
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=40
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=41
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=42
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=43
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=44
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=45
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=46
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=47
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=48
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=49
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=50
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=51
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=52
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=53
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=54
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=55
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=56
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=57
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=58
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=59
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=60
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=61
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=62
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=63
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=64
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=65
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=66
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=67
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=68
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=69
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=70
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=71
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=72
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=73
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=74
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=75
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=76
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=77
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=78
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=79
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=80
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=81
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=82
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=83
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=84
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=85
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=86
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=87
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=88
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=89
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=90
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=91
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=92
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=93
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=94
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=95
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=96
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=97
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=98
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=99
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=100
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=101
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=102
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=103
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=104
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=105
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=106
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=107
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=108
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=109
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=110
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=111
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=112
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=113
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=114
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=115
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=116
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=117
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=118
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=119
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=120
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=121
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=122
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=123
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=124
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=125
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=126
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=127
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=128
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=129
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=130
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=131
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=132
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=133
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=134
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=135
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=136
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=137
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=138
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=139
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=140
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=141
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=142
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=143
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=144
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=145
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=146
DELETE FROM dbo.AnagMacchine WHERE idxMacchina=147
UPDATE dbo.AnagMacchine SET 
  modello=N'FÄSSLER D-250'
  WHERE idxMacchina=597
UPDATE dbo.AnagMacchine SET 
  modello=N'HÖFLER ZP 630 CN'
  WHERE idxMacchina=615
UPDATE dbo.AnagMacchine SET 
  modello=N'HÖFLER EMZ 632 CN'
  WHERE idxMacchina=616
UPDATE dbo.AnagMacchine SET 
  modello=N'HÖFLER ZW630 CN'
  WHERE idxMacchina=617
UPDATE dbo.AnagMacchine SET 
  nomeMacchina=N'Macchina prova rumorosità'
  WHERE idxMacchina=618
GO

GO

set identity_insert dbo.AnagMacchine off
GO

commit transaction
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

INSERT INTO dbo.AnagPriorita
  VALUES (5, N'Lavoro urgente', N'semaforoRosso')
GO

COMMIT TRANSACTION
GO

SET xact_abort ON
GO

BEGIN TRANSACTION
GO

INSERT INTO dbo.AnagrOperMtz
  VALUES (N'0000', N'Selezionare', N'Operatore')
INSERT INTO dbo.AnagrOperMtz
  VALUES (N'000191', N'ALLIERI', N'PIERANGELO')
INSERT INTO dbo.AnagrOperMtz
  VALUES (N'000300', N'ARMANNI', N'FRANCO')
INSERT INTO dbo.AnagrOperMtz
  VALUES (N'000324', N'BENA', N'ANDREA')
INSERT INTO dbo.AnagrOperMtz
  VALUES (N'000349', N'BONETTI', N'GIUSEPPE')
INSERT INTO dbo.AnagrOperMtz
  VALUES (N'000410', N'PEZZOTTA', N'ANGELO')
GO

COMMIT TRANSACTION
GO




SET xact_abort ON
GO

BEGIN TRANSACTION
GO

INSERT INTO dbo.Macchine2FamMacchine
  VALUES (425, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (426, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (427, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (428, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (429, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (430, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (431, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (432, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (433, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (434, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (435, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (436, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (437, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (438, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (439, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (440, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (441, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (442, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (443, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (444, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (445, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (446, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (447, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (448, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (449, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (450, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (451, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (452, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (453, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (454, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (455, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (456, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (457, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (458, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (459, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (460, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (461, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (462, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (463, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (464, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (465, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (466, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (467, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (468, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (469, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (470, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (471, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (472, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (473, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (474, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (475, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (476, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (477, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (478, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (479, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (480, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (481, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (482, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (483, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (484, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (485, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (486, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (487, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (488, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (489, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (490, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (491, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (492, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (493, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (494, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (495, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (496, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (497, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (498, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (499, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (500, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (501, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (502, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (503, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (504, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (505, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (506, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (507, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (508, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (509, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (510, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (511, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (512, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (513, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (514, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (515, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (516, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (517, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (518, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (519, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (520, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (521, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (522, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (523, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (524, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (525, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (526, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (527, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (528, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (529, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (530, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (531, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (532, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (533, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (534, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (535, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (536, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (537, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (538, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (539, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (540, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (541, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (542, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (543, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (544, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (545, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (546, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (547, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (548, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (549, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (550, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (551, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (552, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (553, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (554, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (555, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (556, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (557, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (558, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (559, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (560, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (561, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (562, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (563, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (564, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (565, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (566, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (567, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (568, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (569, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (570, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (571, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (572, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (573, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (574, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (575, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (576, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (577, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (578, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (579, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (580, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (581, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (582, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (583, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (584, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (585, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (586, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (587, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (588, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (589, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (590, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (591, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (592, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (593, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (594, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (595, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (596, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (597, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (598, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (599, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (600, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (601, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (602, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (603, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (604, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (605, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (606, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (607, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (608, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (609, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (610, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (611, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (612, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (613, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (614, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (615, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (616, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (617, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (618, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (619, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (620, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (621, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (622, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (623, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (624, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (625, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (626, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (627, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (628, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (629, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (630, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (631, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (632, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (633, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (634, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (635, 1)
INSERT INTO dbo.Macchine2FamMacchine
  VALUES (636, 1)
GO

COMMIT TRANSACTION
GO


SET xact_abort ON
GO

BEGIN TRANSACTION
GO

UPDATE dbo.Permessi SET 
  GRUPPO=1, NUMERO=13
  WHERE COD_PERMESSO='ANAG_causali'
UPDATE dbo.Permessi SET 
  GRUPPO=1, NUMERO=12
  WHERE COD_PERMESSO='ANAG_famMacc'
INSERT INTO dbo.Permessi
  VALUES ('ANAG_gestUtenti', 'gestUtentiGIM.aspx', 1, 11, 'GestioneUtenti', 'GestioneUtentiLong')
INSERT INTO dbo.Permessi
  VALUES ('ANAG_opMtz', 'AnagOperatoriMtz.aspx', 1, 14, 'GestOperMtz', 'GestOperMtzLong')
GO

COMMIT TRANSACTION
GO


SET xact_abort ON
GO

BEGIN TRANSACTION
GO

INSERT INTO dbo.Permessi2Funzione
  VALUES ('ANAG_gestUtenti', N'GIM_AppAdmin', NULL)
INSERT INTO dbo.Permessi2Funzione
  VALUES ('ANAG_opMtz', N'GIM_SU', NULL)
INSERT INTO dbo.Permessi2Funzione
  VALUES ('RicMan_edit', N'GIM_U', NULL)
DELETE FROM dbo.Permessi2Funzione WHERE COD_PERMESSO='RicMan_edit' AND COD_FUNZIONE=N'GIM_SU'
GO

COMMIT TRANSACTION
GO




-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(3, GETDATE())
GO
