Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dbConn = pymssql.connect(server=mssql_server, user=mssql_user, password=mssql_pass, database=mssql_db)
- cursor = dbConn.cursor()
- date = data[0:6]
- time = data[7:11]
- duration = data[12:16]
- mssql_output_raw = "('%s','%s','%s');" % (date, time, duration)
- mssql_output = mssql_output_raw.replace(" ", "") # Remove any whitespace
- # Write to MSSQL table
- try:
- query = "INSERT INTO %s VALUES %s" % (mssql_table, mssql_output)
- cursor.execute( query )
- dbConn.commit()
- except pymssql.OperationalError as e:
- logmsg("pymssql.OperationalError exception caught: %s" % str(e).replace("n", " ") )
- except:
- pass
- 20019,
- 'DB-Lib error message 20019, severity 7:
- Attempt to initiate a new Adaptive Server operation with results pending
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement