Skip to content

Instantly share code, notes, and snippets.

@anthonyeden
Created March 31, 2018 06:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anthonyeden/db265e389089760d2736d9b584320478 to your computer and use it in GitHub Desktop.
Save anthonyeden/db265e389089760d2736d9b584320478 to your computer and use it in GitHub Desktop.
RCS Zetta: Deletion Date Remover
"""
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