[Tutor] Truncating a Table

Andreas Kostyrka andreas at kostyrka.org
Fri May 11 17:42:46 CEST 2007

Commit it?

-- Ursprüngl. Mitteil. --
Betreff:	[Tutor] Truncating a Table
Von:	"Leon Keylin" <ethics at gmail.com>
Datum:		11.05.2007 15:39

Why would this not work?

import pymssql

con = pymssql.connect(host='server
cur = con.cursor()

query="TRUNCATE TABLE Consolidatedmsgs;"
print "Table Truncated: %d rows deleted" % cur.rowcount
The return I get is that the program runs through but it doesn't actually
truncate the table.
The user that runs this has all the rights (read, write, truncate, etc...)

Any ideas? And yes, I am using a pymssql extension module.

Tutor maillist  -  Tutor at python.org

More information about the Tutor mailing list