-
Notifications
You must be signed in to change notification settings - Fork 561
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cursor.fast_executemany with SQL Server temporary table mis-handles Unicode under Python3 #295
Comments
Update: The same test with a permanent table does not reproduce the issue. Perhaps this is a limitation of |
Yes, it appears that the SP does not support temporary tables. Running the call manually after creating the temp table results in an "invalid object name" error. Note that this would succeed if you use an older ODBC driver, like SQL Server (SQLSRV32.DLL), since it does not use that SP to implement SQLDescribeParam --- it uses the deprecated-but-working FMTONLY instead. |
Bummer. It seems to me that a common usage case would be to
Given that we already know the column types when we create the #temporary table, perhaps we can specify them explicitly using |
As a workaround, you can use a global (i.e. ## prefix) instead of local temporary table. |
You may also try the preview of the next msodbcsql driver, and set |
Should we close this? Keep it open as long as you need a discussion area. I'm just going through the issues to make the next build. |
@gordthompson Yes, you should be able to use the |
The
Cursor.fast_executemany
feature introduced in 4.0.18/19 does not seem to handle Unicode characters correctly under Python3 when working with a SQL Server temporary table. The test codeworks as expected, producing
but when I enable the new feature with
crsr.fast_executemany = True
I getSQL Profiler shows the following
Notice that the parameter type is mis-identified as
varchar(255)
when it really should benvarchar(1)
.The text was updated successfully, but these errors were encountered: