42 lines
1.5 KiB
Transact-SQL
42 lines
1.5 KiB
Transact-SQL
-- 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
|