spostamento update SQL
This commit is contained in:
+420
-420
@@ -1,420 +1,420 @@
|
||||
/****************************************************************
|
||||
* SteamWare s.r.l.
|
||||
*
|
||||
* Setup iniziale DB applicazione WebGIM con eliminazione oggetti
|
||||
*
|
||||
* modificato: 2009-01-23 S.E.L.
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
/* elimino funzioni */
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('f_padLeft') IS NULL
|
||||
DROP FUNCTION f_padLeft
|
||||
GO
|
||||
|
||||
IF NOT object_id('rightDivision') IS NULL
|
||||
DROP FUNCTION rightDivision
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* elimino stored */
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_clonaImpianto') IS NULL
|
||||
DROP PROCEDURE sp_clonaImpianto
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_clonaMacchina') IS NULL
|
||||
DROP PROCEDURE sp_clonaMacchina
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_elencoIntMTBF_MTTR') IS NULL
|
||||
DROP PROCEDURE sp_elencoIntMTBF_MTTR
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_insRichiesta') IS NULL
|
||||
DROP PROCEDURE sp_insRichiesta
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_procStatEv') IS NULL
|
||||
DROP PROCEDURE sp_procStatEv
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_setPresaInCarico') IS NULL
|
||||
DROP PROCEDURE sp_setPresaInCarico
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_spostaMacchina') IS NULL
|
||||
DROP PROCEDURE sp_spostaMacchina
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_updateIntervento') IS NULL
|
||||
DROP PROCEDURE sp_updateIntervento
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_updateInterventoFull') IS NULL
|
||||
DROP PROCEDURE sp_updateInterventoFull
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* elimino le viste... */
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_datiMTBFMTTR') IS NULL
|
||||
DROP VIEW v_datiMTBFMTTR
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_elencoImpiantiMacchine') IS NULL
|
||||
DROP VIEW v_elencoImpiantiMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_elencoIntervFilt') IS NULL
|
||||
DROP VIEW v_elencoIntervFilt
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_interventiErogati') IS NULL
|
||||
DROP VIEW v_interventiErogati
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_intervExp') IS NULL
|
||||
DROP VIEW v_intervExp
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_macchine') IS NULL
|
||||
DROP VIEW v_macchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_mtzProgExp') IS NULL
|
||||
DROP VIEW v_mtzProgExp
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selAmbiti') IS NULL
|
||||
DROP VIEW v_selAmbiti
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selCausaliMacchine') IS NULL
|
||||
DROP VIEW v_selCausaliMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selFamMacc') IS NULL
|
||||
DROP VIEW v_selFamMacc
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selFreq') IS NULL
|
||||
DROP VIEW v_selFreq
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selImpianti') IS NULL
|
||||
DROP VIEW v_selImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selMacchine') IS NULL
|
||||
DROP VIEW v_selMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selPeriodiTrad') IS NULL
|
||||
DROP VIEW v_selPeriodiTrad
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selPrior') IS NULL
|
||||
DROP VIEW v_selPrior
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selSemafori') IS NULL
|
||||
DROP VIEW v_selSemafori
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selStato') IS NULL
|
||||
DROP VIEW v_selStato
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selTipoGuasto') IS NULL
|
||||
DROP VIEW v_selTipoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_vocabolario') IS NULL
|
||||
DROP VIEW v_vocabolario
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*Svuoto eventuali tabelle già presenti...*/
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagAmbitoGuasto') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagAmbitoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagAmbitoGuasto') IS NULL
|
||||
DROP TABLE AnagAmbitoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Causali2FamMacchine_AnagCausali') IS NULL
|
||||
|
||||
ALTER TABLE Causali2FamMacchine DROP
|
||||
CONSTRAINT FK_Causali2FamMacchine_AnagCausali
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagCausali') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagCausali
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagCausali') IS NULL
|
||||
DROP TABLE AnagCausali
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Tra_Ev2Stati_AnagEventi') IS NULL
|
||||
|
||||
ALTER TABLE Tra_Ev2Stati DROP
|
||||
CONSTRAINT FK_Tra_Ev2Stati_AnagEventi
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagEventi') IS NULL
|
||||
DROP TABLE AnagEventi
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Causali2FamMacchine_AnagFamMacchine') IS NULL
|
||||
|
||||
ALTER TABLE Causali2FamMacchine DROP
|
||||
CONSTRAINT FK_Causali2FamMacchine_AnagFamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Macchine2FamMacchine_AnagFamMacchine') IS NULL
|
||||
|
||||
ALTER TABLE Macchine2FamMacchine DROP
|
||||
CONSTRAINT FK_Macchine2FamMacchine_AnagFamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagFamMacchine') IS NULL
|
||||
DROP TABLE AnagFamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_MtzProgrammata_AnagFrequenze') IS NULL
|
||||
|
||||
ALTER TABLE MtzProgrammata DROP
|
||||
CONSTRAINT FK_MtzProgrammata_AnagFrequenze
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagFrequenze') IS NULL
|
||||
DROP TABLE AnagFrequenze
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_FiltroImpianti_AnagImpianti') IS NULL
|
||||
|
||||
ALTER TABLE FiltroImpianti DROP
|
||||
CONSTRAINT FK_FiltroImpianti_AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagImpianti') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_AnagMacchine_AnagImpianti') IS NULL
|
||||
|
||||
ALTER TABLE AnagMacchine DROP
|
||||
CONSTRAINT FK_AnagMacchine_AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagImpianti') IS NULL
|
||||
DROP TABLE AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_MtzProgrammata_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE MtzProgrammata DROP
|
||||
CONSTRAINT FK_MtzProgrammata_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_FiltroMacchine_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE FiltroMacchine DROP
|
||||
CONSTRAINT FK_FiltroMacchine_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Macchine2FamMacchine_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE Macchine2FamMacchine DROP
|
||||
CONSTRAINT FK_Macchine2FamMacchine_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagMacchine') IS NULL
|
||||
DROP TABLE AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagPeriodi') IS NULL
|
||||
DROP TABLE AnagPeriodi
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagPriorita') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagPriorita
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagPriorita') IS NULL
|
||||
DROP TABLE AnagPriorita
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagSemafori') IS NULL
|
||||
DROP TABLE AnagSemafori
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Tra_Ev2Stati_AnagStati') IS NULL
|
||||
|
||||
ALTER TABLE Tra_Ev2Stati DROP
|
||||
CONSTRAINT FK_Tra_Ev2Stati_AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_FiltroStati_AnagStati') IS NULL
|
||||
|
||||
ALTER TABLE FiltroStati DROP
|
||||
CONSTRAINT FK_FiltroStati_AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagStati') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagStati') IS NULL
|
||||
DROP TABLE AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagTipoGuasto') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagTipoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagTipoGuasto') IS NULL
|
||||
DROP TABLE AnagTipoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('CalendFesteFerie') IS NULL
|
||||
DROP TABLE CalendFesteFerie
|
||||
GO
|
||||
|
||||
IF NOT object_id('Causali2FamMacchine') IS NULL
|
||||
DROP TABLE Causali2FamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FiltroImpianti') IS NULL
|
||||
DROP TABLE FiltroImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FiltroMacchine') IS NULL
|
||||
DROP TABLE FiltroMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FiltroStati') IS NULL
|
||||
DROP TABLE FiltroStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventoOpMtz_InterventiMtz') IS NULL
|
||||
|
||||
ALTER TABLE InterventoOpMtz DROP
|
||||
CONSTRAINT FK_InterventoOpMtz_InterventiMtz
|
||||
GO
|
||||
|
||||
IF NOT object_id('InterventiMtz') IS NULL
|
||||
DROP TABLE InterventiMtz
|
||||
GO
|
||||
|
||||
IF NOT object_id('InterventoOpMtz') IS NULL
|
||||
DROP TABLE InterventoOpMtz
|
||||
GO
|
||||
|
||||
IF NOT object_id('LogUpdateDb') IS NULL
|
||||
DROP TABLE LogUpdateDb
|
||||
GO
|
||||
|
||||
IF NOT object_id('Macchine2FamMacchine') IS NULL
|
||||
DROP TABLE Macchine2FamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('MtzProgPending') IS NULL
|
||||
DROP TABLE MtzProgPending
|
||||
GO
|
||||
|
||||
IF NOT object_id('MtzProgrammata') IS NULL
|
||||
DROP TABLE MtzProgrammata
|
||||
GO
|
||||
|
||||
IF NOT object_id('OreAperturaSett') IS NULL
|
||||
DROP TABLE OreAperturaSett
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Permessi2Funzione_Permessi') IS NULL
|
||||
|
||||
ALTER TABLE Permessi2Funzione DROP
|
||||
CONSTRAINT FK_Permessi2Funzione_Permessi
|
||||
GO
|
||||
|
||||
IF NOT object_id('Permessi') IS NULL
|
||||
DROP TABLE Permessi
|
||||
GO
|
||||
|
||||
IF NOT object_id('Permessi2Funzione') IS NULL
|
||||
DROP TABLE Permessi2Funzione
|
||||
GO
|
||||
|
||||
IF NOT object_id('Tra_Ev2Stati') IS NULL
|
||||
DROP TABLE Tra_Ev2Stati
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
/****************************************************************
|
||||
* SteamWare s.r.l.
|
||||
*
|
||||
* Setup iniziale DB applicazione WebGIM con eliminazione oggetti
|
||||
*
|
||||
* modificato: 2009-01-23 S.E.L.
|
||||
*
|
||||
****************************************************************/
|
||||
|
||||
/* elimino funzioni */
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('f_padLeft') IS NULL
|
||||
DROP FUNCTION f_padLeft
|
||||
GO
|
||||
|
||||
IF NOT object_id('rightDivision') IS NULL
|
||||
DROP FUNCTION rightDivision
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* elimino stored */
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_clonaImpianto') IS NULL
|
||||
DROP PROCEDURE sp_clonaImpianto
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_clonaMacchina') IS NULL
|
||||
DROP PROCEDURE sp_clonaMacchina
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_elencoIntMTBF_MTTR') IS NULL
|
||||
DROP PROCEDURE sp_elencoIntMTBF_MTTR
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_insRichiesta') IS NULL
|
||||
DROP PROCEDURE sp_insRichiesta
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_procStatEv') IS NULL
|
||||
DROP PROCEDURE sp_procStatEv
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_setPresaInCarico') IS NULL
|
||||
DROP PROCEDURE sp_setPresaInCarico
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_spostaMacchina') IS NULL
|
||||
DROP PROCEDURE sp_spostaMacchina
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_updateIntervento') IS NULL
|
||||
DROP PROCEDURE sp_updateIntervento
|
||||
GO
|
||||
|
||||
IF NOT object_id('sp_updateInterventoFull') IS NULL
|
||||
DROP PROCEDURE sp_updateInterventoFull
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/* elimino le viste... */
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_datiMTBFMTTR') IS NULL
|
||||
DROP VIEW v_datiMTBFMTTR
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_elencoImpiantiMacchine') IS NULL
|
||||
DROP VIEW v_elencoImpiantiMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_elencoIntervFilt') IS NULL
|
||||
DROP VIEW v_elencoIntervFilt
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_interventiErogati') IS NULL
|
||||
DROP VIEW v_interventiErogati
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_intervExp') IS NULL
|
||||
DROP VIEW v_intervExp
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_macchine') IS NULL
|
||||
DROP VIEW v_macchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_mtzProgExp') IS NULL
|
||||
DROP VIEW v_mtzProgExp
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selAmbiti') IS NULL
|
||||
DROP VIEW v_selAmbiti
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selCausaliMacchine') IS NULL
|
||||
DROP VIEW v_selCausaliMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selFamMacc') IS NULL
|
||||
DROP VIEW v_selFamMacc
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selFreq') IS NULL
|
||||
DROP VIEW v_selFreq
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selImpianti') IS NULL
|
||||
DROP VIEW v_selImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selMacchine') IS NULL
|
||||
DROP VIEW v_selMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selPeriodiTrad') IS NULL
|
||||
DROP VIEW v_selPeriodiTrad
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selPrior') IS NULL
|
||||
DROP VIEW v_selPrior
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selSemafori') IS NULL
|
||||
DROP VIEW v_selSemafori
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selStato') IS NULL
|
||||
DROP VIEW v_selStato
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_selTipoGuasto') IS NULL
|
||||
DROP VIEW v_selTipoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('v_vocabolario') IS NULL
|
||||
DROP VIEW v_vocabolario
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*Svuoto eventuali tabelle già presenti...*/
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagAmbitoGuasto') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagAmbitoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagAmbitoGuasto') IS NULL
|
||||
DROP TABLE AnagAmbitoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Causali2FamMacchine_AnagCausali') IS NULL
|
||||
|
||||
ALTER TABLE Causali2FamMacchine DROP
|
||||
CONSTRAINT FK_Causali2FamMacchine_AnagCausali
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagCausali') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagCausali
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagCausali') IS NULL
|
||||
DROP TABLE AnagCausali
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Tra_Ev2Stati_AnagEventi') IS NULL
|
||||
|
||||
ALTER TABLE Tra_Ev2Stati DROP
|
||||
CONSTRAINT FK_Tra_Ev2Stati_AnagEventi
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagEventi') IS NULL
|
||||
DROP TABLE AnagEventi
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Causali2FamMacchine_AnagFamMacchine') IS NULL
|
||||
|
||||
ALTER TABLE Causali2FamMacchine DROP
|
||||
CONSTRAINT FK_Causali2FamMacchine_AnagFamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Macchine2FamMacchine_AnagFamMacchine') IS NULL
|
||||
|
||||
ALTER TABLE Macchine2FamMacchine DROP
|
||||
CONSTRAINT FK_Macchine2FamMacchine_AnagFamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagFamMacchine') IS NULL
|
||||
DROP TABLE AnagFamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_MtzProgrammata_AnagFrequenze') IS NULL
|
||||
|
||||
ALTER TABLE MtzProgrammata DROP
|
||||
CONSTRAINT FK_MtzProgrammata_AnagFrequenze
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagFrequenze') IS NULL
|
||||
DROP TABLE AnagFrequenze
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_FiltroImpianti_AnagImpianti') IS NULL
|
||||
|
||||
ALTER TABLE FiltroImpianti DROP
|
||||
CONSTRAINT FK_FiltroImpianti_AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagImpianti') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_AnagMacchine_AnagImpianti') IS NULL
|
||||
|
||||
ALTER TABLE AnagMacchine DROP
|
||||
CONSTRAINT FK_AnagMacchine_AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagImpianti') IS NULL
|
||||
DROP TABLE AnagImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_MtzProgrammata_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE MtzProgrammata DROP
|
||||
CONSTRAINT FK_MtzProgrammata_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_FiltroMacchine_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE FiltroMacchine DROP
|
||||
CONSTRAINT FK_FiltroMacchine_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Macchine2FamMacchine_AnagMacchine') IS NULL
|
||||
|
||||
ALTER TABLE Macchine2FamMacchine DROP
|
||||
CONSTRAINT FK_Macchine2FamMacchine_AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagMacchine') IS NULL
|
||||
DROP TABLE AnagMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagPeriodi') IS NULL
|
||||
DROP TABLE AnagPeriodi
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagPriorita') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagPriorita
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagPriorita') IS NULL
|
||||
DROP TABLE AnagPriorita
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagSemafori') IS NULL
|
||||
DROP TABLE AnagSemafori
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Tra_Ev2Stati_AnagStati') IS NULL
|
||||
|
||||
ALTER TABLE Tra_Ev2Stati DROP
|
||||
CONSTRAINT FK_Tra_Ev2Stati_AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_FiltroStati_AnagStati') IS NULL
|
||||
|
||||
ALTER TABLE FiltroStati DROP
|
||||
CONSTRAINT FK_FiltroStati_AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagStati') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagStati') IS NULL
|
||||
DROP TABLE AnagStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventiMtz_AnagTipoGuasto') IS NULL
|
||||
|
||||
ALTER TABLE InterventiMtz DROP
|
||||
CONSTRAINT FK_InterventiMtz_AnagTipoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('AnagTipoGuasto') IS NULL
|
||||
DROP TABLE AnagTipoGuasto
|
||||
GO
|
||||
|
||||
IF NOT object_id('CalendFesteFerie') IS NULL
|
||||
DROP TABLE CalendFesteFerie
|
||||
GO
|
||||
|
||||
IF NOT object_id('Causali2FamMacchine') IS NULL
|
||||
DROP TABLE Causali2FamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FiltroImpianti') IS NULL
|
||||
DROP TABLE FiltroImpianti
|
||||
GO
|
||||
|
||||
IF NOT object_id('FiltroMacchine') IS NULL
|
||||
DROP TABLE FiltroMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('FiltroStati') IS NULL
|
||||
DROP TABLE FiltroStati
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_InterventoOpMtz_InterventiMtz') IS NULL
|
||||
|
||||
ALTER TABLE InterventoOpMtz DROP
|
||||
CONSTRAINT FK_InterventoOpMtz_InterventiMtz
|
||||
GO
|
||||
|
||||
IF NOT object_id('InterventiMtz') IS NULL
|
||||
DROP TABLE InterventiMtz
|
||||
GO
|
||||
|
||||
IF NOT object_id('InterventoOpMtz') IS NULL
|
||||
DROP TABLE InterventoOpMtz
|
||||
GO
|
||||
|
||||
IF NOT object_id('LogUpdateDb') IS NULL
|
||||
DROP TABLE LogUpdateDb
|
||||
GO
|
||||
|
||||
IF NOT object_id('Macchine2FamMacchine') IS NULL
|
||||
DROP TABLE Macchine2FamMacchine
|
||||
GO
|
||||
|
||||
IF NOT object_id('MtzProgPending') IS NULL
|
||||
DROP TABLE MtzProgPending
|
||||
GO
|
||||
|
||||
IF NOT object_id('MtzProgrammata') IS NULL
|
||||
DROP TABLE MtzProgrammata
|
||||
GO
|
||||
|
||||
IF NOT object_id('OreAperturaSett') IS NULL
|
||||
DROP TABLE OreAperturaSett
|
||||
GO
|
||||
|
||||
IF NOT object_id('FK_Permessi2Funzione_Permessi') IS NULL
|
||||
|
||||
ALTER TABLE Permessi2Funzione DROP
|
||||
CONSTRAINT FK_Permessi2Funzione_Permessi
|
||||
GO
|
||||
|
||||
IF NOT object_id('Permessi') IS NULL
|
||||
DROP TABLE Permessi
|
||||
GO
|
||||
|
||||
IF NOT object_id('Permessi2Funzione') IS NULL
|
||||
DROP TABLE Permessi2Funzione
|
||||
GO
|
||||
|
||||
IF NOT object_id('Tra_Ev2Stati') IS NULL
|
||||
DROP TABLE Tra_Ev2Stati
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
+2908
-2908
File diff suppressed because it is too large
Load Diff
+991
-991
File diff suppressed because it is too large
Load Diff
+2567
-2567
File diff suppressed because it is too large
Load Diff
+38
-38
@@ -1,38 +1,38 @@
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
ALTER VIEW v_elencoIntervFilt
|
||||
AS
|
||||
SELECT TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento, ISNULL(dbo.InterventiMtz.descrizioneIntervento, 'n.d. (report mtz)') AS descrizioneIntervento, ISNULL(dbo.AnagCausali.descrCausale,
|
||||
'n.d. (causale)') AS descrCausale, ISNULL(dbo.v_interventiErogati.totMinErogati / 60, 0) AS minErogati, ISNULL(DATEDIFF(hour, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento), 0) AS durataMtz, CASE (isFermo) WHEN 1 THEN ISNULL(DATEDIFF(hour, dbo.InterventiMtz.guasto, dbo.InterventiMtz.fineIntervento),
|
||||
0) WHEN 0 THEN ISNULL(DATEDIFF(hour, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) END AS durataOff, dbo.InterventiMtz.guasto,
|
||||
dbo.InterventiMtz.idxStato, dbo.InterventiMtz.idxImpianto, dbo.InterventiMtz.idxMacchina
|
||||
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.v_interventiErogati ON dbo.InterventiMtz.numIntMtz = dbo.v_interventiErogati.numIntMtz LEFT OUTER JOIN
|
||||
dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
|
||||
ORDER BY dbo.InterventiMtz.numIntMtz DESC
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(4, GETDATE())
|
||||
GO
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
ALTER VIEW v_elencoIntervFilt
|
||||
AS
|
||||
SELECT TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento, ISNULL(dbo.InterventiMtz.descrizioneIntervento, 'n.d. (report mtz)') AS descrizioneIntervento, ISNULL(dbo.AnagCausali.descrCausale,
|
||||
'n.d. (causale)') AS descrCausale, ISNULL(dbo.v_interventiErogati.totMinErogati / 60, 0) AS minErogati, ISNULL(DATEDIFF(hour, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento), 0) AS durataMtz, CASE (isFermo) WHEN 1 THEN ISNULL(DATEDIFF(hour, dbo.InterventiMtz.guasto, dbo.InterventiMtz.fineIntervento),
|
||||
0) WHEN 0 THEN ISNULL(DATEDIFF(hour, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) END AS durataOff, dbo.InterventiMtz.guasto,
|
||||
dbo.InterventiMtz.idxStato, dbo.InterventiMtz.idxImpianto, dbo.InterventiMtz.idxMacchina
|
||||
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.v_interventiErogati ON dbo.InterventiMtz.numIntMtz = dbo.v_interventiErogati.numIntMtz LEFT OUTER JOIN
|
||||
dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
|
||||
ORDER BY dbo.InterventiMtz.numIntMtz DESC
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(4, GETDATE())
|
||||
GO
|
||||
+327
-327
@@ -1,327 +1,327 @@
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
-- =============================================
|
||||
-- Author: Marco Salvi
|
||||
-- Create date: 11/03/2009
|
||||
-- Description: Stored procedure per ricostruire gli indici e fare lo shrink su un db
|
||||
-- =============================================
|
||||
CREATE PROCEDURE sp_IndiciAndShrink
|
||||
(
|
||||
@databaseName sysname
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
-- elimino eventuale tab temporanea preesistente
|
||||
IF (SELECT COUNT(*) FROM TEMPDB..SYSOBJECTS WHERE NAME = '##TMP_nomiTabelle') > 0
|
||||
BEGIN
|
||||
DROP TABLE ##TMP_nomiTabelle
|
||||
END
|
||||
|
||||
-- enumero le tab del db in una tab temporanea
|
||||
SELECT IDENT = IDENTITY (INT,1,1), NAME
|
||||
INTO ##TMP_nomiTabelle
|
||||
FROM sys.Tables
|
||||
|
||||
-- eseguo reindicizzazione
|
||||
DECLARE @VAR1 INT
|
||||
SET @VAR1 = 1
|
||||
WHILE @VAR1 < = ( SELECT COUNT(*) FROM ##TMP_nomiTabelle)
|
||||
BEGIN
|
||||
|
||||
DECLARE @OBJECTNAME VARCHAR(256)
|
||||
|
||||
-- carico il nome della tab i-esima
|
||||
SELECT @OBJECTNAME = NAME
|
||||
FROM ##TMP_nomiTabelle
|
||||
WHERE [IDENT] = @VAR1
|
||||
|
||||
-- rebuild indice
|
||||
DBCC DBREINDEX(@OBJECTNAME)
|
||||
|
||||
-- incremento
|
||||
SET @VAR1 = @VAR1 + 1
|
||||
|
||||
END
|
||||
|
||||
--shrink del db
|
||||
DBCC SHRINKDATABASE (@databaseName)
|
||||
|
||||
END
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
ALTER VIEW v_elencoIntervFilt
|
||||
AS
|
||||
SELECT TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento, ISNULL(dbo.InterventiMtz.descrizioneIntervento, 'n.d. (report mtz)') AS descrizioneIntervento, ISNULL(dbo.AnagCausali.descrCausale,
|
||||
'n.d. (causale)') AS descrCausale, ROUND(CAST(ISNULL(dbo.v_interventiErogati.totMinErogati, 0) AS FLOAT) / 60, 2) AS minErogati,
|
||||
ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS FLOAT) / 60, 2) AS durataMtz, CASE (isFermo)
|
||||
WHEN 1 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.guasto, dbo.InterventiMtz.fineIntervento), 0) AS FLOAT) / 60, 2)
|
||||
WHEN 0 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS FLOAT) / 60, 2) END AS durataOff,
|
||||
dbo.InterventiMtz.guasto, dbo.InterventiMtz.idxStato, dbo.InterventiMtz.idxImpianto, dbo.InterventiMtz.idxMacchina
|
||||
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.v_interventiErogati ON dbo.InterventiMtz.numIntMtz = dbo.v_interventiErogati.numIntMtz LEFT OUTER JOIN
|
||||
dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
|
||||
ORDER BY dbo.InterventiMtz.numIntMtz DESC
|
||||
GO
|
||||
|
||||
EXEC sp_updateextendedproperty '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 = "InterventiMtz"
|
||||
Begin Extent =
|
||||
Top = 8
|
||||
Left = 486
|
||||
Bottom = 354
|
||||
Right = 671
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagAmbitoGuasto"
|
||||
Begin Extent =
|
||||
Top = 11
|
||||
Left = 82
|
||||
Bottom = 89
|
||||
Right = 255
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagImpianti"
|
||||
Begin Extent =
|
||||
Top = 123
|
||||
Left = 219
|
||||
Bottom = 231
|
||||
Right = 370
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagMacchine"
|
||||
Begin Extent =
|
||||
Top = 190
|
||||
Left = 826
|
||||
Bottom = 298
|
||||
Right = 977
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagTipoGuasto"
|
||||
Begin Extent =
|
||||
Top = 90
|
||||
Left = 1143
|
||||
Bottom = 168
|
||||
Right = 1294
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagPriorita"
|
||||
Begin Extent =
|
||||
Top = 23
|
||||
Left = 958
|
||||
Bottom = 116
|
||||
Right = 1109
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagStati"
|
||||
Begin Extent =
|
||||
Top = 263
|
||||
Left = 90
|
||||
Bottom = 356
|
||||
Right = 241
|
||||
', 'SCHEMA', 'dbo', 'VIEW', 'v_elencoIntervFilt'
|
||||
GO
|
||||
|
||||
EXEC sp_updateextendedproperty 'MS_DiagramPane2', ' End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "v_interventiErogati"
|
||||
Begin Extent =
|
||||
Top = 3
|
||||
Left = 739
|
||||
Bottom = 81
|
||||
Right = 890
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagCausali"
|
||||
Begin Extent =
|
||||
Top = 291
|
||||
Left = 1011
|
||||
Bottom = 369
|
||||
Right = 1162
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
End
|
||||
End
|
||||
Begin SQLPane =
|
||||
End
|
||||
Begin DataPane =
|
||||
Begin ParameterDefaults = ""
|
||||
End
|
||||
Begin ColumnWidths = 30
|
||||
Width = 284
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1665
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1575
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
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_elencoIntervFilt'
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(5, GETDATE())
|
||||
GO
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
-- =============================================
|
||||
-- Author: Marco Salvi
|
||||
-- Create date: 11/03/2009
|
||||
-- Description: Stored procedure per ricostruire gli indici e fare lo shrink su un db
|
||||
-- =============================================
|
||||
CREATE PROCEDURE sp_IndiciAndShrink
|
||||
(
|
||||
@databaseName sysname
|
||||
)
|
||||
AS
|
||||
BEGIN
|
||||
|
||||
-- elimino eventuale tab temporanea preesistente
|
||||
IF (SELECT COUNT(*) FROM TEMPDB..SYSOBJECTS WHERE NAME = '##TMP_nomiTabelle') > 0
|
||||
BEGIN
|
||||
DROP TABLE ##TMP_nomiTabelle
|
||||
END
|
||||
|
||||
-- enumero le tab del db in una tab temporanea
|
||||
SELECT IDENT = IDENTITY (INT,1,1), NAME
|
||||
INTO ##TMP_nomiTabelle
|
||||
FROM sys.Tables
|
||||
|
||||
-- eseguo reindicizzazione
|
||||
DECLARE @VAR1 INT
|
||||
SET @VAR1 = 1
|
||||
WHILE @VAR1 < = ( SELECT COUNT(*) FROM ##TMP_nomiTabelle)
|
||||
BEGIN
|
||||
|
||||
DECLARE @OBJECTNAME VARCHAR(256)
|
||||
|
||||
-- carico il nome della tab i-esima
|
||||
SELECT @OBJECTNAME = NAME
|
||||
FROM ##TMP_nomiTabelle
|
||||
WHERE [IDENT] = @VAR1
|
||||
|
||||
-- rebuild indice
|
||||
DBCC DBREINDEX(@OBJECTNAME)
|
||||
|
||||
-- incremento
|
||||
SET @VAR1 = @VAR1 + 1
|
||||
|
||||
END
|
||||
|
||||
--shrink del db
|
||||
DBCC SHRINKDATABASE (@databaseName)
|
||||
|
||||
END
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
SET xact_abort ON
|
||||
GO
|
||||
|
||||
BEGIN TRANSACTION
|
||||
GO
|
||||
|
||||
SET ANSI_NULLS ON
|
||||
GO
|
||||
|
||||
ALTER VIEW v_elencoIntervFilt
|
||||
AS
|
||||
SELECT TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento, ISNULL(dbo.InterventiMtz.descrizioneIntervento, 'n.d. (report mtz)') AS descrizioneIntervento, ISNULL(dbo.AnagCausali.descrCausale,
|
||||
'n.d. (causale)') AS descrCausale, ROUND(CAST(ISNULL(dbo.v_interventiErogati.totMinErogati, 0) AS FLOAT) / 60, 2) AS minErogati,
|
||||
ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS FLOAT) / 60, 2) AS durataMtz, CASE (isFermo)
|
||||
WHEN 1 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.guasto, dbo.InterventiMtz.fineIntervento), 0) AS FLOAT) / 60, 2)
|
||||
WHEN 0 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS FLOAT) / 60, 2) END AS durataOff,
|
||||
dbo.InterventiMtz.guasto, dbo.InterventiMtz.idxStato, dbo.InterventiMtz.idxImpianto, dbo.InterventiMtz.idxMacchina
|
||||
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.v_interventiErogati ON dbo.InterventiMtz.numIntMtz = dbo.v_interventiErogati.numIntMtz LEFT OUTER JOIN
|
||||
dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
|
||||
ORDER BY dbo.InterventiMtz.numIntMtz DESC
|
||||
GO
|
||||
|
||||
EXEC sp_updateextendedproperty '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 = "InterventiMtz"
|
||||
Begin Extent =
|
||||
Top = 8
|
||||
Left = 486
|
||||
Bottom = 354
|
||||
Right = 671
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagAmbitoGuasto"
|
||||
Begin Extent =
|
||||
Top = 11
|
||||
Left = 82
|
||||
Bottom = 89
|
||||
Right = 255
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagImpianti"
|
||||
Begin Extent =
|
||||
Top = 123
|
||||
Left = 219
|
||||
Bottom = 231
|
||||
Right = 370
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagMacchine"
|
||||
Begin Extent =
|
||||
Top = 190
|
||||
Left = 826
|
||||
Bottom = 298
|
||||
Right = 977
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagTipoGuasto"
|
||||
Begin Extent =
|
||||
Top = 90
|
||||
Left = 1143
|
||||
Bottom = 168
|
||||
Right = 1294
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagPriorita"
|
||||
Begin Extent =
|
||||
Top = 23
|
||||
Left = 958
|
||||
Bottom = 116
|
||||
Right = 1109
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagStati"
|
||||
Begin Extent =
|
||||
Top = 263
|
||||
Left = 90
|
||||
Bottom = 356
|
||||
Right = 241
|
||||
', 'SCHEMA', 'dbo', 'VIEW', 'v_elencoIntervFilt'
|
||||
GO
|
||||
|
||||
EXEC sp_updateextendedproperty 'MS_DiagramPane2', ' End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "v_interventiErogati"
|
||||
Begin Extent =
|
||||
Top = 3
|
||||
Left = 739
|
||||
Bottom = 81
|
||||
Right = 890
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagCausali"
|
||||
Begin Extent =
|
||||
Top = 291
|
||||
Left = 1011
|
||||
Bottom = 369
|
||||
Right = 1162
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
End
|
||||
End
|
||||
Begin SQLPane =
|
||||
End
|
||||
Begin DataPane =
|
||||
Begin ParameterDefaults = ""
|
||||
End
|
||||
Begin ColumnWidths = 30
|
||||
Width = 284
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1665
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1575
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
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_elencoIntervFilt'
|
||||
GO
|
||||
|
||||
COMMIT
|
||||
GO
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(5, GETDATE())
|
||||
GO
|
||||
+434
-434
@@ -1,434 +1,434 @@
|
||||
/* modifiche per gestione corretta reportistica x mtz preventiva o meno... */
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
alter table InterventiMtz add
|
||||
scheduled bit constraint DF_InterventiMtz_scheduled default (0)
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', 'indica se l''intervento sia stato generato da manutenzione programmata/preventiva', 'USER', 'dbo', 'TABLE', 'InterventiMtz', 'COLUMN', 'scheduled'
|
||||
go
|
||||
|
||||
update InterventiMtz set scheduled=0
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
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,
|
||||
@scheduled bit,
|
||||
@numIntMtz int output
|
||||
)
|
||||
AS
|
||||
|
||||
BEGIN tran
|
||||
|
||||
INSERT INTO InterventiMtz
|
||||
(richiesta, dataLav, turnoLav, matr, guasto, idxAmbito, idxPriorita, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxStato, idxCausale, scheduled)
|
||||
VALUES (@richiesta,@dataLav,@turnoLav,@matr,@guasto,@idxAmbito,@idxPriorita,@isFermo,@idxTipo,@idxImpianto,@idxMacchina,@descrizione,
|
||||
1,@idxCausale,@scheduled)
|
||||
|
||||
/*************************************
|
||||
* salvo idx del nuovo record
|
||||
**************************************/
|
||||
SET @numIntMtz = SCOPE_IDENTITY()
|
||||
|
||||
COMMIT tran
|
||||
|
||||
RETURN (@numIntMtz)
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
/* aggiorno: se Ambito Guasto è 7 allora è mtz Prog... */
|
||||
UPDATE InterventiMtz
|
||||
SET scheduled = 1
|
||||
WHERE (idxAmbito = 7)
|
||||
GO
|
||||
|
||||
|
||||
/* indici! */
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
create index i_username on FiltroImpianti(username)
|
||||
go
|
||||
|
||||
create index i_username on FiltroMacchine(username)
|
||||
go
|
||||
|
||||
create index i_username on FiltroStati(username)
|
||||
go
|
||||
|
||||
create index i_richiesta on InterventiMtz(richiesta)
|
||||
go
|
||||
|
||||
create index i_impianto on InterventiMtz(idxImpianto)
|
||||
go
|
||||
|
||||
create index i_macchina on InterventiMtz(idxMacchina)
|
||||
go
|
||||
|
||||
create index i_stato on InterventiMtz(idxStato)
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
/* update view */
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
alter VIEW v_elencoIntervFilt
|
||||
AS
|
||||
SELECT TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento, ISNULL(dbo.InterventiMtz.descrizioneIntervento, 'n.d. (report mtz)') AS descrizioneIntervento,
|
||||
ISNULL(dbo.AnagCausali.descrCausale, 'n.d. (causale)') AS descrCausale, ROUND(CAST(ISNULL(dbo.v_interventiErogati.totMinErogati, 0) AS float) / 60, 2)
|
||||
AS minErogati, ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS float) / 60, 2) AS durataMtz,
|
||||
CASE (isFermo) WHEN 1 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.guasto, dbo.InterventiMtz.fineIntervento), 0) AS float) / 60, 2)
|
||||
WHEN 0 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS float) / 60, 2) END AS durataOff,
|
||||
dbo.InterventiMtz.guasto, dbo.InterventiMtz.idxStato, dbo.InterventiMtz.idxImpianto, dbo.InterventiMtz.idxMacchina, dbo.InterventiMtz.isFermo,
|
||||
dbo.InterventiMtz.scheduled
|
||||
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.v_interventiErogati ON dbo.InterventiMtz.numIntMtz = dbo.v_interventiErogati.numIntMtz LEFT OUTER JOIN
|
||||
dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
|
||||
ORDER BY dbo.InterventiMtz.numIntMtz DESC
|
||||
go
|
||||
|
||||
exec sp_updateextendedproperty '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 = "InterventiMtz"
|
||||
Begin Extent =
|
||||
Top = 8
|
||||
Left = 486
|
||||
Bottom = 354
|
||||
Right = 671
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 5
|
||||
End
|
||||
Begin Table = "AnagAmbitoGuasto"
|
||||
Begin Extent =
|
||||
Top = 11
|
||||
Left = 82
|
||||
Bottom = 89
|
||||
Right = 255
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagImpianti"
|
||||
Begin Extent =
|
||||
Top = 123
|
||||
Left = 219
|
||||
Bottom = 231
|
||||
Right = 370
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagMacchine"
|
||||
Begin Extent =
|
||||
Top = 190
|
||||
Left = 826
|
||||
Bottom = 298
|
||||
Right = 977
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagTipoGuasto"
|
||||
Begin Extent =
|
||||
Top = 90
|
||||
Left = 1143
|
||||
Bottom = 168
|
||||
Right = 1294
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagPriorita"
|
||||
Begin Extent =
|
||||
Top = 23
|
||||
Left = 958
|
||||
Bottom = 116
|
||||
Right = 1109
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagStati"
|
||||
Begin Extent =
|
||||
Top = 263
|
||||
Left = 90
|
||||
Bottom = 356
|
||||
Right = 241
|
||||
', 'SCHEMA', 'dbo', 'VIEW', 'v_elencoIntervFilt'
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
/* nuove stored + stored con filtraggio esteso! */
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntByIntervDate
|
||||
* Recupera elenco interventi a partire dalle date inizio/fine di ricerca
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntByIntervDate
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT codImpianto, codMacchina, descrCausale, descrizione, descrizioneIntervento, durataMtz, durataOff, fineIntervento, guasto, idxImpianto, idxMacchina, idxStato,
|
||||
inizioIntervento, minErogati, nomeImpianto, nomeMacchina, numIntMtz, richiesta, isFermo, scheduled
|
||||
FROM v_elencoIntervFilt
|
||||
WHERE (richiesta BETWEEN @inizio AND @fine)
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntByIntervDateUserFilt
|
||||
* Recupera elenco interventi a partire dalle date inizio/fine di ricerca e dall'username ed i relativi filtri di ricerca salvati
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntByIntervDateUserFilt
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(50)
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina, v_elencoIntervFilt.descrCausale, v_elencoIntervFilt.descrizione,
|
||||
v_elencoIntervFilt.descrizioneIntervento, v_elencoIntervFilt.durataMtz, v_elencoIntervFilt.durataOff, v_elencoIntervFilt.fineIntervento, v_elencoIntervFilt.guasto,
|
||||
v_elencoIntervFilt.idxImpianto, v_elencoIntervFilt.idxMacchina, v_elencoIntervFilt.idxStato, v_elencoIntervFilt.inizioIntervento, v_elencoIntervFilt.minErogati,
|
||||
v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina, v_elencoIntervFilt.numIntMtz, v_elencoIntervFilt.richiesta, v_elencoIntervFilt.isFermo,
|
||||
v_elencoIntervFilt.scheduled
|
||||
FROM v_elencoIntervFilt INNER JOIN
|
||||
FiltroImpianti ON v_elencoIntervFilt.idxImpianto = FiltroImpianti.idxImpianto INNER JOIN
|
||||
FiltroMacchine ON v_elencoIntervFilt.idxMacchina = FiltroMacchine.idxMacchina INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username) AND (FiltroMacchine.username = @username) AND
|
||||
(FiltroImpianti.username = @username)
|
||||
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntByIntervDateUserFilt
|
||||
* Recupera elenco interventi a partire dalle date inizio/fine di ricerca e dall'username ed i relativi filtri di ricerca salvati
|
||||
* e con rispetto filtro x int a macchian ferma o di mtz preventiva
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntByIntervDateUserFilt_fermaPrev
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(50),
|
||||
@soloMaccFerma BIT,
|
||||
@includiPreventiva BIT
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina, v_elencoIntervFilt.descrCausale, v_elencoIntervFilt.descrizione,
|
||||
v_elencoIntervFilt.descrizioneIntervento, v_elencoIntervFilt.durataMtz, v_elencoIntervFilt.durataOff, v_elencoIntervFilt.fineIntervento,
|
||||
v_elencoIntervFilt.guasto, v_elencoIntervFilt.idxImpianto, v_elencoIntervFilt.idxMacchina, v_elencoIntervFilt.idxStato,
|
||||
v_elencoIntervFilt.inizioIntervento, v_elencoIntervFilt.minErogati, v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina,
|
||||
v_elencoIntervFilt.numIntMtz, v_elencoIntervFilt.richiesta, v_elencoIntervFilt.isFermo, v_elencoIntervFilt.scheduled
|
||||
FROM v_elencoIntervFilt INNER JOIN
|
||||
FiltroImpianti ON v_elencoIntervFilt.idxImpianto = FiltroImpianti.idxImpianto INNER JOIN
|
||||
FiltroMacchine ON v_elencoIntervFilt.idxMacchina = FiltroMacchine.idxMacchina INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username)
|
||||
AND (FiltroMacchine.username = @username) AND (FiltroImpianti.username = @username)
|
||||
AND (v_elencoIntervFilt.isFermo = case @soloMaccFerma when 1 then 1 else v_elencoIntervFilt.isFermo end)
|
||||
AND (v_elencoIntervFilt.scheduled = case @includiPreventiva when 0 then 0 else v_elencoIntervFilt.scheduled end)
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntMTBF_MTTR_fermaPrev
|
||||
* Restituisce elenco degli interventi x fare il calcolo MTBF/MTTR FILTRANDO per:
|
||||
* - idxStati
|
||||
* - idxImpianto
|
||||
* - idxMacchina
|
||||
* - solo ferma
|
||||
* - inclusione preventiva
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntMTBF_MTTR_fermaPrev
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(100),
|
||||
@soloMaccFerma BIT,
|
||||
@includiPreventiva BIT
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT COUNT(v_elencoIntervFilt.numIntMtz) AS numInterventi, SUM(v_elencoIntervFilt.durataMtz) AS totOreMtz,
|
||||
SUM(v_elencoIntervFilt.durataOff) AS totOreOfficina, v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina,
|
||||
v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina
|
||||
FROM FiltroImpianti INNER JOIN FiltroMacchine INNER JOIN v_elencoIntervFilt INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato ON FiltroMacchine.idxMacchina = v_elencoIntervFilt.idxMacchina ON
|
||||
FiltroImpianti.idxImpianto = v_elencoIntervFilt.idxImpianto
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username) AND (FiltroMacchine.username = @username) AND
|
||||
(FiltroImpianti.username = @username) AND (v_elencoIntervFilt.isFermo = CASE @soloMaccFerma WHEN 1 THEN 1 ELSE v_elencoIntervFilt.isFermo END)
|
||||
AND (v_elencoIntervFilt.scheduled = CASE @includiPreventiva WHEN 0 THEN 0 ELSE v_elencoIntervFilt.scheduled END)
|
||||
GROUP BY v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina, v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(6, GETDATE())
|
||||
GO
|
||||
/* modifiche per gestione corretta reportistica x mtz preventiva o meno... */
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
alter table InterventiMtz add
|
||||
scheduled bit constraint DF_InterventiMtz_scheduled default (0)
|
||||
go
|
||||
|
||||
exec sp_addextendedproperty 'MS_Description', 'indica se l''intervento sia stato generato da manutenzione programmata/preventiva', 'USER', 'dbo', 'TABLE', 'InterventiMtz', 'COLUMN', 'scheduled'
|
||||
go
|
||||
|
||||
update InterventiMtz set scheduled=0
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
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,
|
||||
@scheduled bit,
|
||||
@numIntMtz int output
|
||||
)
|
||||
AS
|
||||
|
||||
BEGIN tran
|
||||
|
||||
INSERT INTO InterventiMtz
|
||||
(richiesta, dataLav, turnoLav, matr, guasto, idxAmbito, idxPriorita, isFermo, idxTipo, idxImpianto, idxMacchina, descrizione, idxStato, idxCausale, scheduled)
|
||||
VALUES (@richiesta,@dataLav,@turnoLav,@matr,@guasto,@idxAmbito,@idxPriorita,@isFermo,@idxTipo,@idxImpianto,@idxMacchina,@descrizione,
|
||||
1,@idxCausale,@scheduled)
|
||||
|
||||
/*************************************
|
||||
* salvo idx del nuovo record
|
||||
**************************************/
|
||||
SET @numIntMtz = SCOPE_IDENTITY()
|
||||
|
||||
COMMIT tran
|
||||
|
||||
RETURN (@numIntMtz)
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
/* aggiorno: se Ambito Guasto è 7 allora è mtz Prog... */
|
||||
UPDATE InterventiMtz
|
||||
SET scheduled = 1
|
||||
WHERE (idxAmbito = 7)
|
||||
GO
|
||||
|
||||
|
||||
/* indici! */
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
create index i_username on FiltroImpianti(username)
|
||||
go
|
||||
|
||||
create index i_username on FiltroMacchine(username)
|
||||
go
|
||||
|
||||
create index i_username on FiltroStati(username)
|
||||
go
|
||||
|
||||
create index i_richiesta on InterventiMtz(richiesta)
|
||||
go
|
||||
|
||||
create index i_impianto on InterventiMtz(idxImpianto)
|
||||
go
|
||||
|
||||
create index i_macchina on InterventiMtz(idxMacchina)
|
||||
go
|
||||
|
||||
create index i_stato on InterventiMtz(idxStato)
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
/* update view */
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
alter VIEW v_elencoIntervFilt
|
||||
AS
|
||||
SELECT TOP (100) PERCENT dbo.InterventiMtz.numIntMtz, dbo.InterventiMtz.richiesta, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.InterventiMtz.descrizione, dbo.InterventiMtz.inizioIntervento,
|
||||
dbo.InterventiMtz.fineIntervento, ISNULL(dbo.InterventiMtz.descrizioneIntervento, 'n.d. (report mtz)') AS descrizioneIntervento,
|
||||
ISNULL(dbo.AnagCausali.descrCausale, 'n.d. (causale)') AS descrCausale, ROUND(CAST(ISNULL(dbo.v_interventiErogati.totMinErogati, 0) AS float) / 60, 2)
|
||||
AS minErogati, ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS float) / 60, 2) AS durataMtz,
|
||||
CASE (isFermo) WHEN 1 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.guasto, dbo.InterventiMtz.fineIntervento), 0) AS float) / 60, 2)
|
||||
WHEN 0 THEN ROUND(CAST(ISNULL(DATEDIFF(minute, dbo.InterventiMtz.inizioIntervento, dbo.InterventiMtz.fineIntervento), 0) AS float) / 60, 2) END AS durataOff,
|
||||
dbo.InterventiMtz.guasto, dbo.InterventiMtz.idxStato, dbo.InterventiMtz.idxImpianto, dbo.InterventiMtz.idxMacchina, dbo.InterventiMtz.isFermo,
|
||||
dbo.InterventiMtz.scheduled
|
||||
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.v_interventiErogati ON dbo.InterventiMtz.numIntMtz = dbo.v_interventiErogati.numIntMtz LEFT OUTER JOIN
|
||||
dbo.AnagCausali ON dbo.InterventiMtz.idxCausale = dbo.AnagCausali.idxCausale
|
||||
ORDER BY dbo.InterventiMtz.numIntMtz DESC
|
||||
go
|
||||
|
||||
exec sp_updateextendedproperty '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 = "InterventiMtz"
|
||||
Begin Extent =
|
||||
Top = 8
|
||||
Left = 486
|
||||
Bottom = 354
|
||||
Right = 671
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 5
|
||||
End
|
||||
Begin Table = "AnagAmbitoGuasto"
|
||||
Begin Extent =
|
||||
Top = 11
|
||||
Left = 82
|
||||
Bottom = 89
|
||||
Right = 255
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagImpianti"
|
||||
Begin Extent =
|
||||
Top = 123
|
||||
Left = 219
|
||||
Bottom = 231
|
||||
Right = 370
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagMacchine"
|
||||
Begin Extent =
|
||||
Top = 190
|
||||
Left = 826
|
||||
Bottom = 298
|
||||
Right = 977
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagTipoGuasto"
|
||||
Begin Extent =
|
||||
Top = 90
|
||||
Left = 1143
|
||||
Bottom = 168
|
||||
Right = 1294
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagPriorita"
|
||||
Begin Extent =
|
||||
Top = 23
|
||||
Left = 958
|
||||
Bottom = 116
|
||||
Right = 1109
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagStati"
|
||||
Begin Extent =
|
||||
Top = 263
|
||||
Left = 90
|
||||
Bottom = 356
|
||||
Right = 241
|
||||
', 'SCHEMA', 'dbo', 'VIEW', 'v_elencoIntervFilt'
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
/* nuove stored + stored con filtraggio esteso! */
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntByIntervDate
|
||||
* Recupera elenco interventi a partire dalle date inizio/fine di ricerca
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntByIntervDate
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT codImpianto, codMacchina, descrCausale, descrizione, descrizioneIntervento, durataMtz, durataOff, fineIntervento, guasto, idxImpianto, idxMacchina, idxStato,
|
||||
inizioIntervento, minErogati, nomeImpianto, nomeMacchina, numIntMtz, richiesta, isFermo, scheduled
|
||||
FROM v_elencoIntervFilt
|
||||
WHERE (richiesta BETWEEN @inizio AND @fine)
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntByIntervDateUserFilt
|
||||
* Recupera elenco interventi a partire dalle date inizio/fine di ricerca e dall'username ed i relativi filtri di ricerca salvati
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntByIntervDateUserFilt
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(50)
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina, v_elencoIntervFilt.descrCausale, v_elencoIntervFilt.descrizione,
|
||||
v_elencoIntervFilt.descrizioneIntervento, v_elencoIntervFilt.durataMtz, v_elencoIntervFilt.durataOff, v_elencoIntervFilt.fineIntervento, v_elencoIntervFilt.guasto,
|
||||
v_elencoIntervFilt.idxImpianto, v_elencoIntervFilt.idxMacchina, v_elencoIntervFilt.idxStato, v_elencoIntervFilt.inizioIntervento, v_elencoIntervFilt.minErogati,
|
||||
v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina, v_elencoIntervFilt.numIntMtz, v_elencoIntervFilt.richiesta, v_elencoIntervFilt.isFermo,
|
||||
v_elencoIntervFilt.scheduled
|
||||
FROM v_elencoIntervFilt INNER JOIN
|
||||
FiltroImpianti ON v_elencoIntervFilt.idxImpianto = FiltroImpianti.idxImpianto INNER JOIN
|
||||
FiltroMacchine ON v_elencoIntervFilt.idxMacchina = FiltroMacchine.idxMacchina INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username) AND (FiltroMacchine.username = @username) AND
|
||||
(FiltroImpianti.username = @username)
|
||||
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntByIntervDateUserFilt
|
||||
* Recupera elenco interventi a partire dalle date inizio/fine di ricerca e dall'username ed i relativi filtri di ricerca salvati
|
||||
* e con rispetto filtro x int a macchian ferma o di mtz preventiva
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntByIntervDateUserFilt_fermaPrev
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(50),
|
||||
@soloMaccFerma BIT,
|
||||
@includiPreventiva BIT
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina, v_elencoIntervFilt.descrCausale, v_elencoIntervFilt.descrizione,
|
||||
v_elencoIntervFilt.descrizioneIntervento, v_elencoIntervFilt.durataMtz, v_elencoIntervFilt.durataOff, v_elencoIntervFilt.fineIntervento,
|
||||
v_elencoIntervFilt.guasto, v_elencoIntervFilt.idxImpianto, v_elencoIntervFilt.idxMacchina, v_elencoIntervFilt.idxStato,
|
||||
v_elencoIntervFilt.inizioIntervento, v_elencoIntervFilt.minErogati, v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina,
|
||||
v_elencoIntervFilt.numIntMtz, v_elencoIntervFilt.richiesta, v_elencoIntervFilt.isFermo, v_elencoIntervFilt.scheduled
|
||||
FROM v_elencoIntervFilt INNER JOIN
|
||||
FiltroImpianti ON v_elencoIntervFilt.idxImpianto = FiltroImpianti.idxImpianto INNER JOIN
|
||||
FiltroMacchine ON v_elencoIntervFilt.idxMacchina = FiltroMacchine.idxMacchina INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username)
|
||||
AND (FiltroMacchine.username = @username) AND (FiltroImpianti.username = @username)
|
||||
AND (v_elencoIntervFilt.isFermo = case @soloMaccFerma when 1 then 1 else v_elencoIntervFilt.isFermo end)
|
||||
AND (v_elencoIntervFilt.scheduled = case @includiPreventiva when 0 then 0 else v_elencoIntervFilt.scheduled end)
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE stp_elencoIntMTBF_MTTR_fermaPrev
|
||||
* Restituisce elenco degli interventi x fare il calcolo MTBF/MTTR FILTRANDO per:
|
||||
* - idxStati
|
||||
* - idxImpianto
|
||||
* - idxMacchina
|
||||
* - solo ferma
|
||||
* - inclusione preventiva
|
||||
*
|
||||
* modif.: S.E.L. - 2010.01.25
|
||||
**************************************/
|
||||
create PROCEDURE stp_elencoIntMTBF_MTTR_fermaPrev
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(100),
|
||||
@soloMaccFerma BIT,
|
||||
@includiPreventiva BIT
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT COUNT(v_elencoIntervFilt.numIntMtz) AS numInterventi, SUM(v_elencoIntervFilt.durataMtz) AS totOreMtz,
|
||||
SUM(v_elencoIntervFilt.durataOff) AS totOreOfficina, v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina,
|
||||
v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina
|
||||
FROM FiltroImpianti INNER JOIN FiltroMacchine INNER JOIN v_elencoIntervFilt INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato ON FiltroMacchine.idxMacchina = v_elencoIntervFilt.idxMacchina ON
|
||||
FiltroImpianti.idxImpianto = v_elencoIntervFilt.idxImpianto
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username) AND (FiltroMacchine.username = @username) AND
|
||||
(FiltroImpianti.username = @username) AND (v_elencoIntervFilt.isFermo = CASE @soloMaccFerma WHEN 1 THEN 1 ELSE v_elencoIntervFilt.isFermo END)
|
||||
AND (v_elencoIntervFilt.scheduled = CASE @includiPreventiva WHEN 0 THEN 0 ELSE v_elencoIntervFilt.scheduled END)
|
||||
GROUP BY v_elencoIntervFilt.codImpianto, v_elencoIntervFilt.codMacchina, v_elencoIntervFilt.nomeImpianto, v_elencoIntervFilt.nomeMacchina
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(6, GETDATE())
|
||||
GO
|
||||
+18
-18
@@ -1,19 +1,19 @@
|
||||
/* Sistemo trigger x la gestioen di nuove macchine con le causali sstandard... */
|
||||
|
||||
CREATE TRIGGER updateAssociazioneFamMacchine
|
||||
ON dbo.AnagMacchine
|
||||
FOR INSERT
|
||||
AS
|
||||
|
||||
-- aggiungo le eventuali "macchine orfane" alla fam macchine di base (1 = TUTTE)
|
||||
INSERT INTO Macchine2FamMacchine(idxMacchina, idxFamMacchine)
|
||||
(
|
||||
SELECT am.idxMacchina, 1 FROM anagMacchine am LEFT OUTER JOIN macchine2FamMacchine m2f
|
||||
ON am.idxMacchina=m2f.idxMacchina
|
||||
WHERE m2f.idxmacchina IS NULL
|
||||
)
|
||||
GO
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(7, GETDATE())
|
||||
/* Sistemo trigger x la gestioen di nuove macchine con le causali sstandard... */
|
||||
|
||||
CREATE TRIGGER updateAssociazioneFamMacchine
|
||||
ON dbo.AnagMacchine
|
||||
FOR INSERT
|
||||
AS
|
||||
|
||||
-- aggiungo le eventuali "macchine orfane" alla fam macchine di base (1 = TUTTE)
|
||||
INSERT INTO Macchine2FamMacchine(idxMacchina, idxFamMacchine)
|
||||
(
|
||||
SELECT am.idxMacchina, 1 FROM anagMacchine am LEFT OUTER JOIN macchine2FamMacchine m2f
|
||||
ON am.idxMacchina=m2f.idxMacchina
|
||||
WHERE m2f.idxmacchina IS NULL
|
||||
)
|
||||
GO
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(7, GETDATE())
|
||||
GO
|
||||
+66
-66
@@ -1,67 +1,67 @@
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE sp_elencoIntMTBF_MTTR
|
||||
* Restituisce elenco degli interventi x fare il calcolo MTBF/MTTR FILTRANDO per:
|
||||
* - idxStati
|
||||
* - idxImpianto
|
||||
* - idxMacchina
|
||||
*
|
||||
* modif.: S.E.L. - 2010.05.11
|
||||
**************************************/
|
||||
alter PROCEDURE sp_elencoIntMTBF_MTTR
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(100)
|
||||
)
|
||||
AS
|
||||
|
||||
-- inizio con il creare la vista che mi serve x selezionare gli interventi filtrati dall'utente (per poterli escludere-includere)
|
||||
WITH ElencoInt AS (SELECT v_elencoIntervFilt.*
|
||||
FROM FiltroImpianti INNER JOIN
|
||||
FiltroMacchine INNER JOIN
|
||||
v_elencoIntervFilt INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato ON FiltroMacchine.idxMacchina = v_elencoIntervFilt.idxMacchina ON
|
||||
FiltroImpianti.idxImpianto = v_elencoIntervFilt.idxImpianto
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username) AND (FiltroMacchine.username = @username) AND
|
||||
(FiltroImpianti.username = @username))
|
||||
|
||||
|
||||
-- seleziono gli interventi DAVVERO erogati
|
||||
SELECT COUNT(ElencoInt.numIntMtz) AS numInterventi, SUM(ElencoInt.durataMtz) AS totOreMtz,
|
||||
SUM(ElencoInt.durataOff) AS totOreOfficina, ElencoInt.codImpianto, ElencoInt.codMacchina,
|
||||
ElencoInt.nomeImpianto, ElencoInt.nomeMacchina
|
||||
FROM ElencoInt
|
||||
GROUP BY ElencoInt.codImpianto, ElencoInt.codMacchina, ElencoInt.nomeImpianto, ElencoInt.nomeMacchina
|
||||
|
||||
UNION
|
||||
|
||||
-- seleziono gli impianti che NON hanno ricevuto interventi ma comunque scelti dall'utente...
|
||||
SELECT 0 AS numInterventi, 0 AS totOreMtz, 0 AS totOreOfficina, AnagImpianti.codImpianto, AnagMacchine.codMacchina, AnagImpianti.nomeImpianto,
|
||||
AnagMacchine.nomeMacchina
|
||||
FROM FiltroMacchine INNER JOIN
|
||||
AnagMacchine ON FiltroMacchine.idxMacchina = AnagMacchine.idxMacchina INNER JOIN
|
||||
AnagImpianti ON AnagMacchine.idxImpianto = AnagImpianti.idxImpianto LEFT OUTER JOIN
|
||||
ElencoInt ON FiltroMacchine.idxMacchina = ElencoInt.idxMacchina
|
||||
WHERE (ElencoInt.numIntMtz IS NULL)
|
||||
GROUP BY AnagImpianti.codImpianto, AnagMacchine.codMacchina, AnagImpianti.nomeImpianto, AnagMacchine.nomeMacchina
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(8, GETDATE())
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*************************************
|
||||
* STORED PROCEDURE sp_elencoIntMTBF_MTTR
|
||||
* Restituisce elenco degli interventi x fare il calcolo MTBF/MTTR FILTRANDO per:
|
||||
* - idxStati
|
||||
* - idxImpianto
|
||||
* - idxMacchina
|
||||
*
|
||||
* modif.: S.E.L. - 2010.05.11
|
||||
**************************************/
|
||||
alter PROCEDURE sp_elencoIntMTBF_MTTR
|
||||
(
|
||||
@inizio DATETIME,
|
||||
@fine DATETIME,
|
||||
@username VARCHAR(100)
|
||||
)
|
||||
AS
|
||||
|
||||
-- inizio con il creare la vista che mi serve x selezionare gli interventi filtrati dall'utente (per poterli escludere-includere)
|
||||
WITH ElencoInt AS (SELECT v_elencoIntervFilt.*
|
||||
FROM FiltroImpianti INNER JOIN
|
||||
FiltroMacchine INNER JOIN
|
||||
v_elencoIntervFilt INNER JOIN
|
||||
FiltroStati ON v_elencoIntervFilt.idxStato = FiltroStati.idxStato ON FiltroMacchine.idxMacchina = v_elencoIntervFilt.idxMacchina ON
|
||||
FiltroImpianti.idxImpianto = v_elencoIntervFilt.idxImpianto
|
||||
WHERE (v_elencoIntervFilt.richiesta BETWEEN @inizio AND @fine) AND (FiltroStati.username = @username) AND (FiltroMacchine.username = @username) AND
|
||||
(FiltroImpianti.username = @username))
|
||||
|
||||
|
||||
-- seleziono gli interventi DAVVERO erogati
|
||||
SELECT COUNT(ElencoInt.numIntMtz) AS numInterventi, SUM(ElencoInt.durataMtz) AS totOreMtz,
|
||||
SUM(ElencoInt.durataOff) AS totOreOfficina, ElencoInt.codImpianto, ElencoInt.codMacchina,
|
||||
ElencoInt.nomeImpianto, ElencoInt.nomeMacchina
|
||||
FROM ElencoInt
|
||||
GROUP BY ElencoInt.codImpianto, ElencoInt.codMacchina, ElencoInt.nomeImpianto, ElencoInt.nomeMacchina
|
||||
|
||||
UNION
|
||||
|
||||
-- seleziono gli impianti che NON hanno ricevuto interventi ma comunque scelti dall'utente...
|
||||
SELECT 0 AS numInterventi, 0 AS totOreMtz, 0 AS totOreOfficina, AnagImpianti.codImpianto, AnagMacchine.codMacchina, AnagImpianti.nomeImpianto,
|
||||
AnagMacchine.nomeMacchina
|
||||
FROM FiltroMacchine INNER JOIN
|
||||
AnagMacchine ON FiltroMacchine.idxMacchina = AnagMacchine.idxMacchina INNER JOIN
|
||||
AnagImpianti ON AnagMacchine.idxImpianto = AnagImpianti.idxImpianto LEFT OUTER JOIN
|
||||
ElencoInt ON FiltroMacchine.idxMacchina = ElencoInt.idxMacchina
|
||||
WHERE (ElencoInt.numIntMtz IS NULL)
|
||||
GROUP BY AnagImpianti.codImpianto, AnagMacchine.codMacchina, AnagImpianti.nomeImpianto, AnagMacchine.nomeMacchina
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(8, GETDATE())
|
||||
GO
|
||||
+600
-600
File diff suppressed because it is too large
Load Diff
+110
-110
@@ -1,111 +1,111 @@
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*********************************************************************************
|
||||
* TRIGGER trg_updateMPPending
|
||||
*
|
||||
* eliminazione, in caso di update di un intervento di MtzProgrammata,
|
||||
* dei record di interventi "pending" predisposti... così saranno rigenerati corretti
|
||||
*
|
||||
**********************************************************************************/
|
||||
create TRIGGER trg_updateMPPending
|
||||
ON MtzProgrammata
|
||||
FOR UPDATE, DELETE
|
||||
AS
|
||||
|
||||
BEGIN tran
|
||||
-- elimino interventi pending interessati...
|
||||
DELETE
|
||||
FROM MtzProgPending
|
||||
WHERE idxIntPro IN
|
||||
(
|
||||
-- prendendo gli interventi mtzProgrammata modificati...
|
||||
SELECT DISTINCT idxIntPro FROM DELETED
|
||||
)
|
||||
|
||||
COMMIT tran
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
exec sp_rename 'stp_duplicaMtzProgr', 'stp_MtzProg_duplica', 'object'
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*********************************************************************************
|
||||
* STORED stp_MtzProg_getByKey
|
||||
*
|
||||
* restituisce riga MtzProg
|
||||
*
|
||||
**********************************************************************************/
|
||||
create PROCEDURE stp_MtzProg_getByKey
|
||||
(
|
||||
@idxIntPro INT
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT *
|
||||
FROM MtzProgrammata
|
||||
WHERE idxIntPro = @idxIntPro
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
/*********************************************************************************
|
||||
* STORED stp_MtzProg_update
|
||||
*
|
||||
* aggiorna riga MtzProg
|
||||
*
|
||||
**********************************************************************************/
|
||||
create PROCEDURE stp_MtzProg_update
|
||||
(
|
||||
@idxIntPro INT,
|
||||
@inizio DATETIME,
|
||||
@codFrequenza NCHAR(2),
|
||||
@cadenza INT,
|
||||
@descrizione NVARCHAR(500),
|
||||
@idxPriorita INT,
|
||||
@isFermo BIT,
|
||||
@idxTipo INT
|
||||
)
|
||||
AS
|
||||
|
||||
UPDATE MtzProgrammata
|
||||
SET inizio = @inizio,
|
||||
codFrequenza= @codFrequenza,
|
||||
cadenza = @cadenza,
|
||||
descrizione = @descrizione,
|
||||
idxPriorita = @idxPriorita,
|
||||
isFermo = @isFermo,
|
||||
idxTipo = @idxTipo
|
||||
WHERE idxIntPro = @idxIntPro
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(200, GETDATE())
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*********************************************************************************
|
||||
* TRIGGER trg_updateMPPending
|
||||
*
|
||||
* eliminazione, in caso di update di un intervento di MtzProgrammata,
|
||||
* dei record di interventi "pending" predisposti... così saranno rigenerati corretti
|
||||
*
|
||||
**********************************************************************************/
|
||||
create TRIGGER trg_updateMPPending
|
||||
ON MtzProgrammata
|
||||
FOR UPDATE, DELETE
|
||||
AS
|
||||
|
||||
BEGIN tran
|
||||
-- elimino interventi pending interessati...
|
||||
DELETE
|
||||
FROM MtzProgPending
|
||||
WHERE idxIntPro IN
|
||||
(
|
||||
-- prendendo gli interventi mtzProgrammata modificati...
|
||||
SELECT DISTINCT idxIntPro FROM DELETED
|
||||
)
|
||||
|
||||
COMMIT tran
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
exec sp_rename 'stp_duplicaMtzProgr', 'stp_MtzProg_duplica', 'object'
|
||||
go
|
||||
|
||||
set ANSI_NULLS on
|
||||
go
|
||||
|
||||
/*********************************************************************************
|
||||
* STORED stp_MtzProg_getByKey
|
||||
*
|
||||
* restituisce riga MtzProg
|
||||
*
|
||||
**********************************************************************************/
|
||||
create PROCEDURE stp_MtzProg_getByKey
|
||||
(
|
||||
@idxIntPro INT
|
||||
)
|
||||
AS
|
||||
|
||||
SELECT *
|
||||
FROM MtzProgrammata
|
||||
WHERE idxIntPro = @idxIntPro
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
/*********************************************************************************
|
||||
* STORED stp_MtzProg_update
|
||||
*
|
||||
* aggiorna riga MtzProg
|
||||
*
|
||||
**********************************************************************************/
|
||||
create PROCEDURE stp_MtzProg_update
|
||||
(
|
||||
@idxIntPro INT,
|
||||
@inizio DATETIME,
|
||||
@codFrequenza NCHAR(2),
|
||||
@cadenza INT,
|
||||
@descrizione NVARCHAR(500),
|
||||
@idxPriorita INT,
|
||||
@isFermo BIT,
|
||||
@idxTipo INT
|
||||
)
|
||||
AS
|
||||
|
||||
UPDATE MtzProgrammata
|
||||
SET inizio = @inizio,
|
||||
codFrequenza= @codFrequenza,
|
||||
cadenza = @cadenza,
|
||||
descrizione = @descrizione,
|
||||
idxPriorita = @idxPriorita,
|
||||
isFermo = @isFermo,
|
||||
idxTipo = @idxTipo
|
||||
WHERE idxIntPro = @idxIntPro
|
||||
|
||||
RETURN
|
||||
go
|
||||
|
||||
commit
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(200, GETDATE())
|
||||
GO
|
||||
@@ -0,0 +1,218 @@
|
||||
set xact_abort on;
|
||||
go
|
||||
|
||||
begin transaction;
|
||||
go
|
||||
|
||||
set ANSI_NULLS on;
|
||||
go
|
||||
|
||||
alter VIEW v_mtzProgExp
|
||||
AS
|
||||
SELECT dbo.MtzProgrammata.idxIntPro, dbo.MtzProgrammata.idxMacchina, dbo.AnagImpianti.codImpianto, dbo.AnagImpianti.nomeImpianto,
|
||||
dbo.AnagMacchine.codMacchina, dbo.AnagMacchine.nomeMacchina, dbo.MtzProgrammata.inizio, dbo.MtzProgrammata.codFrequenza,
|
||||
dbo.AnagFrequenze.frequenza, dbo.MtzProgrammata.cadenza, dbo.MtzProgrammata.descrizione, dbo.MtzProgrammata.idxPriorita,
|
||||
dbo.AnagPriorita.descrPriorita, dbo.MtzProgrammata.isFermo, dbo.MtzProgrammata.idxTipo, dbo.AnagTipoGuasto.descrTipo
|
||||
FROM dbo.MtzProgrammata INNER JOIN
|
||||
dbo.AnagMacchine ON dbo.MtzProgrammata.idxMacchina = dbo.AnagMacchine.idxMacchina INNER JOIN
|
||||
dbo.AnagFrequenze ON dbo.MtzProgrammata.codFrequenza = dbo.AnagFrequenze.codFrequenza INNER JOIN
|
||||
dbo.AnagPriorita ON dbo.MtzProgrammata.idxPriorita = dbo.AnagPriorita.idxPriorita INNER JOIN
|
||||
dbo.AnagTipoGuasto ON dbo.MtzProgrammata.idxTipo = dbo.AnagTipoGuasto.idxTipo INNER JOIN
|
||||
dbo.AnagImpianti ON dbo.AnagMacchine.idxImpianto = dbo.AnagImpianti.idxImpianto
|
||||
go
|
||||
|
||||
exec sp_updateextendedproperty '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 = "MtzProgrammata"
|
||||
Begin Extent =
|
||||
Top = 6
|
||||
Left = 38
|
||||
Bottom = 275
|
||||
Right = 189
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagMacchine"
|
||||
Begin Extent =
|
||||
Top = 213
|
||||
Left = 288
|
||||
Bottom = 321
|
||||
Right = 439
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagFrequenze"
|
||||
Begin Extent =
|
||||
Top = 6
|
||||
Left = 416
|
||||
Bottom = 84
|
||||
Right = 567
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagPriorita"
|
||||
Begin Extent =
|
||||
Top = 6
|
||||
Left = 605
|
||||
Bottom = 99
|
||||
Right = 756
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagTipoGuasto"
|
||||
Begin Extent =
|
||||
Top = 6
|
||||
Left = 794
|
||||
Bottom = 84
|
||||
Right = 945
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
Begin Table = "AnagImpianti"
|
||||
Begin Extent =
|
||||
Top = 137
|
||||
Left = 581
|
||||
Bottom = 267
|
||||
Right = 751
|
||||
End
|
||||
DisplayFlags = 280
|
||||
TopColumn = 0
|
||||
End
|
||||
End
|
||||
End
|
||||
Begin SQLPane =
|
||||
End
|
||||
Begin DataPane =
|
||||
Begin ParameterDefaults = ""
|
||||
End
|
||||
Begin ColumnWidths = 17
|
||||
Width = 284
|
||||
Width = 1500', 'SCHEMA', 'dbo', 'VIEW', 'v_mtzProgExp';
|
||||
go
|
||||
|
||||
exec sp_updateextendedproperty 'MS_DiagramPane2', '
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
Width = 1500
|
||||
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_mtzProgExp';
|
||||
go
|
||||
|
||||
commit;
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(221, GETDATE())
|
||||
GO
|
||||
SELECT * FROM LogUpdateDb ORDER BY versione DESC
|
||||
GO
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,130 @@
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
INSERT INTO dbo.AnagClasseTurno
|
||||
VALUES (N'2t5gg', N'2 turni, 5 gg', 80)
|
||||
INSERT INTO dbo.AnagClasseTurno
|
||||
VALUES (N'3t5gg', N'3 turni, 5 gg', 120)
|
||||
go
|
||||
|
||||
commit transaction
|
||||
go
|
||||
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'T1', 6, 14, N'Turno 8h standard')
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'T2', 14, 22, N'Turno 8h standard')
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'T3', 22, 6, N'Turno 8h standard')
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'TA', 0, 6, N'Turno 6h std')
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'TB', 6, 12, N'Turno 6h std')
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'TC', 12, 18, N'Turno 6h std')
|
||||
INSERT INTO dbo.AnagTurni
|
||||
VALUES (N'TD', 18, 24, N'Turno 6h std')
|
||||
go
|
||||
|
||||
commit transaction
|
||||
go
|
||||
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T1', 1, N'Lun')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T1', 2, N'Mar')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T1', 3, N'Mer')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T1', 4, N'Gio')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T1', 5, N'Ven')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T2', 1, N'Lun')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T2', 2, N'Mar')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T2', 3, N'Mer')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T2', 4, N'Gio')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'2t5gg', N'T2', 5, N'Ven')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T1', 1, N'Lun')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T1', 2, N'Mar')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T1', 3, N'Mer')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T1', 4, N'Gio')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T1', 5, N'Ven')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T2', 1, N'Lun')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T2', 2, N'Mar')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T2', 3, N'Mer')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T2', 4, N'Gio')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T2', 5, N'Ven')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T3', 1, N'Lun')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T3', 2, N'Mar')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T3', 3, N'Mer')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T3', 4, N'Gio')
|
||||
INSERT INTO dbo.OreAperturaSettTurni
|
||||
VALUES (N'3t5gg', N'T3', 5, N'Ven')
|
||||
go
|
||||
|
||||
commit transaction
|
||||
go
|
||||
|
||||
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
INSERT INTO dbo.OreChiusuraSett
|
||||
VALUES (6, N'Sab', 16)
|
||||
INSERT INTO dbo.OreChiusuraSett
|
||||
VALUES (7, N'Dom', 24)
|
||||
go
|
||||
|
||||
commit transaction
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(223, GETDATE())
|
||||
GO
|
||||
SELECT * FROM LogUpdateDb ORDER BY versione DESC
|
||||
GO
|
||||
@@ -0,0 +1,784 @@
|
||||
set xact_abort on
|
||||
go
|
||||
|
||||
begin transaction
|
||||
go
|
||||
|
||||
set identity_insert dbo.tmp_importaMacchine on
|
||||
go
|
||||
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=1
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=2
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=3
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=4
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=5
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=6
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=7
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=8
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=9
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=10
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=11
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=12
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=13
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=14
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=15
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=16
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=17
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=18
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=19
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=20
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=21
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=22
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=23
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=24
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=25
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=26
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=27
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=28
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=29
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=30
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=31
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=32
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=33
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=34
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=35
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=36
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=37
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=38
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=39
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=40
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=41
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=42
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=43
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=44
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=45
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=46
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=47
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=48
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=49
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=50
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=51
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=52
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=53
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=54
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=55
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=56
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=57
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=58
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=59
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=60
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=61
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=62
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=63
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=64
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=65
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=66
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=67
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=68
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=69
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=70
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=71
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=72
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=73
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=74
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=75
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=76
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=77
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=78
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=79
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=80
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=81
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=82
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=83
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=84
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=85
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=86
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=87
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=88
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=89
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=90
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=91
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=92
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=93
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=94
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=95
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=96
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=97
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=98
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=99
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=100
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=101
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=102
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=103
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=104
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=105
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=106
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=107
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=108
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=109
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=110
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=111
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=112
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=113
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=114
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=115
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=116
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=117
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=118
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=119
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=120
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=121
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=122
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=123
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=124
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=125
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=126
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=127
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=128
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=129
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=130
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=131
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=132
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=133
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=134
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=135
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=136
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=137
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=138
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=139
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=140
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=141
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=142
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=143
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=144
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=145
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=146
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=147
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=148
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=149
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=150
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=151
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=152
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=153
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=154
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=155
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=156
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=157
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=158
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=159
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=160
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=161
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=162
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=163
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=164
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=165
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=166
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=167
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=168
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=169
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=170
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=171
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=172
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=173
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=174
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=175
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=176
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=177
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=178
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=179
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=180
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=181
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=182
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=183
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=184
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=185
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=186
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=187
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=188
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=189
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=190
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=191
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=192
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=193
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=194
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=195
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=196
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=197
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=198
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=199
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=200
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=201
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=202
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=203
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=204
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=205
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=206
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=207
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=208
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=209
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=210
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=211
|
||||
UPDATE dbo.tmp_importaMacchine SET
|
||||
matricola=N'-'
|
||||
WHERE idx=212
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA1', N'MURATEC 1', N'MURATEC / MW200', N'10KX399490001', 2011, N'SOFT LINE A', 213)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA2', N'FRIGOR MURATEC 1', N'COOLJET / AC24-FP-460 ', N'11-0603', 2011, N'SOFT LINE A', 214)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA3', N'FILTRO CARTA MURATEC 1', N'Cosema Filtrazioni / FB1 OVC08/0151', N'03', 2008, N'SOFT LINE A', 215)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA4', N'MURATEC 2', N'MURATEC / MW200', N'10KX399500001', 2011, N'SOFT LINE A', 216)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA5', N'FRIGOR MURATEC 2', N'COOLJET / AC24-FP-460 ', N'11-0602', 2011, N'SOFT LINE A', 217)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA6', N'FILTRO CARTA MURATEC 2', N'Cosema Filtrazioni / FB1 OVC08/0151', N'01', 2008, N'SOFT LINE A', 218)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA7', N'LIEBHERR', N'LIEBHERR / LC300', N'FN9057', 2011, N'SOFT LINE A', 219)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA8', N'SAMP', N'MAG / CDA250', N'300 407', 2011, N'SOFT LINE A', 220)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA9', N'MARCATRICE BIANCO', N'RRRobotica / AXTRON T2000', N'T14024', 2011, N'SOFT LINE A', 221)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA10', N'ROBOT BIANCO', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E10X06170 / E-43020', 2010, N'SOFT LINE A', 222)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA11', N'LINEA EWAB BIANCO', N'EWAB / PS800', N'P400000', 2011, N'SOFT LINE A', 223)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA12', N'KITAMURA', N'KITAMURA / HX300iF', N'41089', 2011, N'KITAMURA', 224)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA13', N'BROCCIATRICE', N'MANACA', N'051/2011', 2011, N'KITAMURA', 225)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA14', N'ROBOT CARICO/SCARICO KITAMURA', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E10Z01151 / E-43779', 2011, N'KITAMURA', 226)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA15', N'CELLA EWAB KITAMURA', N'EWAB / PS800', N'P400001', 2011, N'KITAMURA', 227)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA16', N'EMAG 1 ', N'EMAG / VSC315', N'102743', 2011, N'HARD LINE A', 228)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA17', N'EMAG 2', N'EMAG / VSC315', N'102742', 2011, N'HARD LINE A', 229)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA18', N'REISHAUER', N'REISHAUER / RZ260C', N'78067', 2011, N'HARD LINE A', 230)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA19', N'FILTRO HOFFMANN', N'HOFFMANN / Filter HSF 100 SE', N'11-0047', 2011, N'HARD LINE A', 231)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA20', N'MARPOSS BANCO 4 -MISURE EMAG', N'MARPOSS BANCO 4 / TMI02198002', N'11G1130936', 2011, N'HARD LINE A', 232)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA21', N'MARPOSS BANCO 5-MISURE REISHAUER', N'MARPOSS BANCO 5 / TMI02198002', N'11G1130937', 2011, N'HARD LINE A', 233)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA22', N'MARCATRICE CEMENTATO', N'RRRobotica / AXTRON T2000', N'T14023', 2011, N'HARD LINE A', 234)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA23', N'LAVATRICE CEMENTATO', N'TECNOFIRMA / SAT-LIN', N'L944', 2013, N'HARD LINE A', 235)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA24', N'ROBOT CARICO/SCARICO CEMENTATO', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E11102351 / E-45541', 2011, N'HARD LINE A', 236)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA25', N'ROBOT MARPOSS BANCO4 ', N'FANUC / M-16iB/20 c\w R-J3iC', N'E11101230 / E-28637', 2011, N'HARD LINE A', 237)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA26', N'ROBOT REISHAUER', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E11102346 / E-45690', 2011, N'HARD LINE A', 238)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA27', N'ROBOT LAVATRICE', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E11200443 / E-45536', 2011, N'HARD LINE A', 239)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA28', N'LINEA EWAB CEMENTATO', N'EWAB / PS800', N'P400002', 2011, N'HARD LINE A', 240)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA29', N'EMAG BOCCOLE', N'EMAG / VSC315', N'102744', 2011, N'SIR 1', 241)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA30', N'PRESSA BOCCOLE', N'OIL SAFE / HPS200/4/40/7.8-3', N'00332/11', 2011, N'SIR 1', 242)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA31', N'LAVATRICE SIR', N'TECNOFIRMA / SAT 3-10', N'L943', 2013, N'SIR 1', 243)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA32', N'MARPOSS BANCO 6-MISURE EMAG BOCCOLE', N'MARPOSS BANCO 6 / TMI02198502', N'11G1130938', 2011, N'SIR 1', 244)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA33', N'ROBOT SIR 1', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E10Z00612 / E-43987', 2010, N'SIR 1', 245)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA34', N'NASTRO EWAB SIR 1', N'EWAB / PS800', N'P400003', 2011, N'SIR 1', 246)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA35', N'IMPIANTO SIR 1', N'SIR / SOMASCHINI USA', N'2400', 2011, N'SIR 1', 247)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA36', N'PRESSA ASSEMBLAGGIO DUPLI', N'REXOIL 892104', N'10012167', 2012, N'SIR 2', 248)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA37', N'FORNO A INDUZIONE', N'ATE / IFC/A-15/2', N'119218', 2012, N'SIR 2', 249)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA38', N'FRIGOR FORNO', N'MTA / Tae Evo 020', N'2200197328', 2012, N'SIR 2', 250)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA39', N'ROBOT SIR 2', N'FANUC / Robot M-710iC Controllore R-J3iC', N'E12231136 / E-53684', 2012, N'SIR 2', 251)
|
||||
INSERT INTO dbo.tmp_importaMacchine
|
||||
(idGest, denominazione, costruttore, matricola, anno, reparto, idx)
|
||||
VALUES (N'USA40', N'IMPIANTO SIR 2', N'SIR / SOMASCHINI USA', N'2502', 2012, N'SIR 2', 252)
|
||||
go
|
||||
|
||||
set identity_insert dbo.tmp_importaMacchine off
|
||||
go
|
||||
|
||||
commit transaction
|
||||
go
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
-- registro versione...
|
||||
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(224, GETDATE())
|
||||
GO
|
||||
SELECT * FROM LogUpdateDb ORDER BY versione DESC
|
||||
GO
|
||||
Reference in New Issue
Block a user