Created
March 31, 2018 06:20
-
-
Save anthonyeden/db265e389089760d2736d9b584320478 to your computer and use it in GitHub Desktop.
RCS Zetta: Deletion Date Remover
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Zetta Deletion Date Remover | |
This script will remove all deletion dates from assets in the Zetta DB, except Voice Tracks and Quick Records. | |
Written by Anthony Eden (https://mediarealm.com.au/) | |
""" | |
import os | |
import sys | |
import json | |
import pypyodbc | |
import io | |
import time | |
import datetime | |
# Setup Zetta SQL DB Connection: | |
SQLConnectionString = 'DSN=ZettaDB;' | |
dbConn = pypyodbc.connect(SQLConnectionString, autocommit = True) | |
cur = dbConn.cursor() | |
def removeDeletionDates(): | |
deletionDatesQuery = ''' | |
UPDATE [ZettaDB].[dbo].[Asset] | |
SET EraseDate = NULL | |
WHERE EraseDate IS NOT NULL | |
AND AssetTypeID <> 5 | |
AND AssetTypeID <> 4 | |
''' | |
cur.execute(deletionDatesQuery) | |
if __name__ == "__main__": | |
removeDeletionDates() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment