Skip to content

Delete Files in Shared Location/SAN

'As a DBA when we have lots of shared location and ForFiles does not work and throws the below error 

***
ERROR: UNC paths (\\machine\share) are not supported.
***

The procedure will be helpful to delete the files. The procedure needs to be run by providing the below details.

exec DeleteOldFiles @path= '\\sharelocation$\servename\transactional_logs\', 
@days = -15
 
To extract the date, sbustring function is used in the procedure. Please make changes as necessary. In my case, I had the DatabaseName_Datetime.trn
 
e.g. MYDatabase_20160905080054.trn
 

Trackbacks

Keine Trackbacks

Kommentare

Ansicht der Kommentare: Linear | Verschachtelt

Noch keine Kommentare

Die Kommentarfunktion wurde vom Besitzer dieses Blogs in diesem Eintrag deaktiviert.

Kommentar schreiben

Standard-Text Smilies wie :-) und ;-) werden zu Bildern konvertiert.

Um maschinelle und automatische Übertragung von Spamkommentaren zu verhindern, bitte die Zeichenfolge im dargestellten Bild in der Eingabemaske eintragen. Nur wenn die Zeichenfolge richtig eingegeben wurde, kann der Kommentar angenommen werden. Bitte beachten Sie, dass Ihr Browser Cookies unterstützen muss, um dieses Verfahren anzuwenden.
CAPTCHA

Formular-Optionen