Import a textfile to MS SQL with python
tim.golden at viacom-outdoor.co.uk
Wed Sep 6 12:49:58 CEST 2006
[joel.sjoo at gmail.com]
| Traceback (most recent call last):
| File "txttosql6.py", line 23, in ?
| File "C:\Python24\Lib\site-packages\pymssql.py", line 120, in execute
| self.executemany(operation, (params,))
| File "C:\Python24\Lib\site-packages\pymssql.py", line 146, in
| raise DatabaseError, "internal error: %s (%s)" %
| (self.__source.errmsg(), se
| pymssql.DatabaseError: internal error: None (None)
Are you calling .execute or .executemany? Your code below
has .execute, but the traceback is coming from .executemany.
If you're using the latter, you need to pass the whole list
mycursor = myconn.cursor()
# omit: for row in data:
"INSERT INTO python (id, namn, efternamn) VALUES (?, ?, ?)",
If that's not the problem, I can't easily see what it is.
I don't usually use pymssql, but I do have it installed,
so if I get a chance later, I'll give it a go.
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
More information about the Python-list