update sql x files troppo lunghi

This commit is contained in:
Samuele Locatelli
2013-02-26 17:49:27 +01:00
parent 59fec2caaf
commit 5cdea5fd26
2 changed files with 41 additions and 0 deletions
+41
View File
@@ -0,0 +1,41 @@
-- aggiorno nomi file > 80
UPDATE tbDocumenti
SET nomeFile = dbo.f_shortString(nomeFile, 80)
WHERE LEN(nomeFile) > 80
AND Anno < 2013
-- aggiorno path > 100
UPDATE tbDocumenti
SET fullPath = dbo.f_pathOldDocs('~/ArchivioDocs',Commessa, Fase, InOut, Fonte, DataDoc, dbo.f_shortString(Oggetto, 40))
WHERE LEN(fullPath) > 100
AND Anno < 2013
-- verifico eventuali ulteriori sforamenti... aggiorno LEN(fullPath) + LEN(nomeFile) > 240
UPDATE tbDocumenti
SET fullPath = dbo.f_pathOldDocs('~/ArchivioDocs',Commessa, Fase, InOut, Fonte, DataDoc, dbo.f_shortString(Oggetto, 30))
,nomeFile = dbo.f_shortString(nomeFile, 30)
where LEN(fullPath) + LEN(nomeFile) > 240
AND Anno < 2013
-- verifico eventuali ulteriori sforamenti rimasti e divento + aggressivo... aggiorno LEN(fullPath) + LEN(nomeFile) > 240
UPDATE tbDocumenti
SET fullPath = dbo.f_pathOldDocs('~/ArchivioDocs',Commessa, Fase, InOut, Fonte, DataDoc, dbo.f_shortString(Oggetto, 25))
,nomeFile = dbo.f_shortString(nomeFile, 20)
where LEN(fullPath) + LEN(nomeFile) > 240
AND Anno < 2013
-- verifico eventuali ulteriori sforamenti rimasti e divento + aggressivo... aggiorno LEN(fullPath) + LEN(nomeFile) > 240
UPDATE tbDocumenti
SET fullPath = dbo.f_pathOldDocs('~/ArchivioDocs',Commessa, Fase, InOut, Fonte, DataDoc, dbo.f_shortString(Oggetto, 25))
,nomeFile = dbo.f_shortString(nomeFile, 20)
where LEN(fullPath) + LEN(nomeFile) > 240
-- registro versione...
INSERT INTO [dbo].[LogUpdateDb] ([Versione],[Data]) VALUES(126, GETDATE())
GO
SELECT TOP 10 * FROM LogUpdateDb ORDER BY Versione DESC
GO