freetds

Can I use pyodbc/freetds and sqlalchemy with decimal data in mssql?

痞子三分冷 提交于 2019-12-10 22:58:36
问题 This has been a long running issue for me. I have a proprietary database that I cannot change and many of the tables have fields which are defined as e.g. decimal(12, 4). When I try to pull data from such a table on ubuntu 12.04 using pyodbc/freeTDS like this... import pyodbc connection_string = 'DRIVER={FreeTDS};DSN=<myDSN>;UID=<my_user>;PWD=<my_password>;' conn = pyodbc.connect(connection_string) cur = conn.cursor() cur.execute('SELECT myfield FROM mytable') for row in cur.fetchall(): print

PDOException: SQLSTATE 01002 Adaptive Server connection failed (severity 9)

大城市里の小女人 提交于 2019-12-10 20:49:59
问题 I have been following some answers over stackoverflow. My odbc. ini (located in /etc/odbc.ini) [MSSQL] Description = MS SQL Server Driver = /usr/local/lib/libtdsodbc.so Server = host.of.the.server UID = myusername PWD = mypassword ReadOnly = No Port = 1433 tds version = 8.0 My odbcinst.ini [FreeTDS] Description = FreeTDS driver Driver = /usr/local/lib/libtdsodbc.so Setup=/usr/lib/odbc/libtdsS.so FileUsage = 1 UsageCount = 1 Both of these files are empty at first. I just copied answer from the

freetds locale.conf, date format

北战南征 提交于 2019-12-10 20:34:11
问题 I'm using freetds and following manual I can set date format in /etc/locale.conf . From origin I didn't have it, so I created it manually. And now I'm getting such date format: May 21 2013 05:30:39:000PM I set locales.conf like this: [default] date format = %Y-%m-%d %H:%M:%S [en_US] date format = %Y-%m-%d %H:%M:%S language = us_english # charset = iso_1 [es_ES] date format = %Y-%m-%d %H:%M:%S language = spanish # charset = iso_1 [pt_BR] date format = %Y-%m-%d %H:%M:%S language = Portuguese #

Issue with returning Cyrillic symbols from MSSQL via unixODBC and FreeTDS

扶醉桌前 提交于 2019-12-10 16:18:13
问题 I'm using django-pyodbc as database backend on Ubuntu 12.04 LTS and MSSQL 2008 on remote host. It works good except of returning Cyrillic symbols. Instead of them I see question marks - '?'. I have begin investigation what could cause this problem. As far as I understand MSSQL-django chain looks so: MSSQL <-> FreeTDS <-> unixODBC <-> pyodbc <-> django-pyodbc So I have started from FreeTDS. When I run query in tsql - it works good I can see all symbols including Cyrillic. The next one was isql

freeTDS bash: Executing sql queries in Microsoft SQL server

南笙酒味 提交于 2019-12-10 13:28:14
问题 I am able to connect to a Microsoft SQL Server 2008 instance via a Mint Linux VM using freeTSD and command line to execute sql statements on it. Now I want automate this in a bash script. I am able to successfully login in my bash script: TDSVER=8.0 tsql -H servername -p 1433 -D dbadmin -U domain\\Administrator -P password I then have my SQL query: USE dbname GO delete from schema.tableA where ID > 5 GO delete from schema.tableB where ID > 5 GO delete from schema.tableC where ID > 5 GO exit

freeTDS: Missing libtdsodbc.so file on OSX?

落爺英雄遲暮 提交于 2019-12-10 12:41:59
问题 I am trying to connect to a SQL server from a python script on a Mac OSX and after installing freeTDS using brew install freeTDS I can't seem to find the driver " libtdsodbc.so " anywhere on my machine so that I can place it in the connection string. Has anyone ever encountered this problem or knows why it's happening? Thanks 回答1: So according to This thread here the issue is with the way freeTDS is built now, you need to use brew install freetds --with-unixodbc and I can verify this fixed my

FreeTDS hangs indefinitely after Microsoft SQL Express 2012 Install

与世无争的帅哥 提交于 2019-12-10 11:07:40
问题 FreeTDS hangs indefinitely when I try to connect to a server: C:\FreeTDS\bin>tsql -H localhost -p 1433 locale is "English_United States.1252" locale charset is "CP1252" using default charset "CP1252" (nothing else is displayed, can only exit with ^C) Identical behaviour occurs when I run tsql -S <servername> . I recently uninstalled Microsoft SQL Server Management Studio, and then installed the Express edition. Connection with tsql -H localhost -p 1433 worked before the uninstall/install.

Why won't my server connect to a remote MSSQL server using PHP mssql_connect?

*爱你&永不变心* 提交于 2019-12-10 10:57:01
问题 I've had to move an app we wrote for a client to a new server and a remote connection I was initiating with PHP mssql_connect has ceased to work. I noticed that PHP wasn't compiled with mssql so I asked the server admin to install it. I can verify that it's now installed via PHP info but I now get a consistent "Unable to connect to server" error from mssql_connect. Here's the very simple PHP script I'm running: $myServer = "myserver.com:5000"; $myUser = "myusername"; $myPass = "mypassword";

Where is FreeTDS installed when I download pymssql on windows?

筅森魡賤 提交于 2019-12-10 10:37:29
问题 I am having trouble connecting pymssql to my local instance of MSSQL, and would like to use the tsql debugging command that is included with FreeTDS. However, I am unable to find where it FreeTDS is installed. As far as I know, it comes pre-compiled with pymssql on windows, I just don't know where it is. More info: I am using windows I am not using a virtual environment I used the package manager included with PyCharm to install pymssql (I assume it wraps pip ) 回答1: AKAIK, pymssql for Windows