0
我得到上述錯誤,而試圖將數據插入到表中,我嘗試了SET NOCOUNT ON選項,以及和仍然有同樣的問題,pyodbc - 以前的SQL不是查詢
import pyodbc as p
connstr= 'DRIVER={SQL Server};SERVER=SQLEXPRESS;DATABASE=TEST;Trusted_Connection=yes;unicode_results=False'
conn = p.connect(connstr,charset='UTF-16')
print conn
cursor = conn.cursor()
try:
result = cursor.execute("""select col1 into tb2 from (select 1 as col1) tb1""")
except Exception as error:
print error
for each in result.fetchall():
print each