[Tutor] MSSQL Connection

johnf jfabiani at yolo.com
Tue May 22 16:19:15 CEST 2007

On Tuesday 22 May 2007 06:35, Leon Keylin wrote:
> Hi John,
> Here's the code (I do have permissions to truncate, works manually under
> the same user.
> import pymssql
> con = pymssql.connect
> (host='server',user='user',password='pwd',database='DB_QA')
> cur = con.cursor()
> query="truncate TABLE bbConsolidatedMessageAcks"
> cur.execute(query)
> print "Deleted Records: %d" % cur.rowcount
I see from the other postings that you are running windows.  I am on SUSE 10.2 
using FreeTDS and pymssql.  In my case my "cur.execute" is passed to FreeTDS 
and FreeTDS is what really interfaces with the SQL server.  I'm also running 
a patch from www.dabodev.com but I doubt that would stop you from passing the 

Are you using pymssql-0.8.0.win32-py2.5.exe and ODBC ? Can you see the trace 
provided by MS SQL?

John Fabiani

More information about the Tutor mailing list