What steps will reproduce the problem?
1.import pyodbc
cn = pyodbc.connect(r'DRIVER={SQL Server Native Client 11.0};Server=servername or IP,1433;DATABASE=SomeDatabase;UID=web;PWD=4Data2Publish;')
cursor = cn.cursor()
cursor.execute(r'select MyColumn from MyTable')
rows = cursor.fetchall()
for row in rows:
print row.MyColumn
cursor.close()
cn.close()
2. This should give me a print of all My Column values.
3. My Column is varchar(100) in database (sql server 2008)
What is the expected output? What do you see instead?
Expected:
Himanshu
Observe
cted
What version of the product are you using? On what operating system?
Python 2.4.3
SQL Server Native Client 11.0
GCC 4.1.2 20080704 (Red Hat 4.1.2-50)
Please provide any additional information below.
First 4 characters are not printed by above code.
sqlcmd works fine but pyodbc fails
sqlcmd
'Microsoft (R) SQL Server Command Line Tool
Version 11.0.1790.0 Linux