pymssql

What are the advantages and disadvantages of using pypyodbc, pymssql, and pyodbc? [closed]

久未见 提交于 2019-12-24 05:14:15
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 4 months ago . I know that Pypyodbc is the newer version of Pyodbc. A question before asked about the comparison between these two but I want to add Pymssql into the mix. 回答1: As of December 2019: pyodbc is under active development, is officially supported by Microsoft (when using the

How to write dataframe into mssql using pymssql?

自闭症网瘾萝莉.ら 提交于 2019-12-24 00:48:10
问题 I am using pymssql to write a df into mssql, but didn't work. from sqlalchemy import create_engine import pymssql engine = create_engine('mssql+pymssql://sa:suzhou@localhost/test_python') data.to_sql('phill',engine) With an error below. What's wrong? NoSuchColumnError: "Could not locate column in row for column '0'" TOP 5 ROWS: Dc_Dist Psa Dispatch_Date_Time Dispatch_Date Dispatch_Time Hour Dc_Key Location_Block UCR_General Text_General_Code Police_Districts Month Lon Lat 3 35 D 2009-07-19 01

Django app hangs when attempting to connect to database via Apache

好久不见. 提交于 2019-12-23 05:42:17
问题 I am having difficulty troubleshooting this issue. I have a Django app running on an Ubuntu 14.04 server (with Apache 2.4 and mod_wsgi for Python 3.4). It connects to SQL Server via pymssql. In development, the app works fine. I query the database, and the database returns the expected results. In production (under the Apache user), however, the script hangs at the exact point that a database query is made. My browser (Chrome or Firefox) shows a spinning wheel that continues to spin as long

Cannot connect to mssql db using pymssql

两盒软妹~` 提交于 2019-12-22 10:56:09
问题 I have FreeTDS installed and configured correctly. My freetds.conf file as this appended to the end: [myserver] host = myserver port = 1433 tds version = 7.0 And I can running the following command gives me a SQL prompt: tsql -S myserver -U username My python script is extremely minimal, in an attempt to successfully connect to the database: #! /path/to/python/bins import pymsql conn = pymssql.connect(host='myserver', user='username', password='password', database='database', as_dict=True)

error: Unable to find vcvarsall.bat when installing PyMSSQL-2.0.0b1… what am i missing?

╄→尐↘猪︶ㄣ 提交于 2019-12-22 10:25:24
问题 Well i am trying to install PyMSSQL-2.0.0b1 and can not achieve this, get strange errors... i have tried some solutions found on Google and StackOverflow but still unable to compile... please what am i missing ? ( so i have tried : - to add --compiler=mingw32 after setup.py install build - to create a distutils.cfd file in Python27\lib\distutils\distutils.cfg with [build] compiler=mingw32 and still not working ) (also i'm on Windows 7, and i has need third party libs, must stick to 32 bits

Trouble installing pymssql on Windows

旧巷老猫 提交于 2019-12-22 08:47:19
问题 I can't find great support for pymssql installation support on Windows. I'm trying to connect to an enterprise database through another employee's python wrapper. This wrapper requires my installing of pymssql. The RTFM on this doesn't have very explicit instructions on the installation process of FreeTDS and OpenSSL. Steps to Install All downloaded files (FreeTDS and OpenSSL) are from the RTFM link mentioned above. There is mention of adding both downloads to a C:\Program Files folder and

Building pymssql on OS X

◇◆丶佛笑我妖孽 提交于 2019-12-22 01:43:16
问题 Attempting to build any version of pymssql on Mac OS X 10.6.6. Both versions 1.0.2 (stable) and 1.9.909 (trunk) build and install, but return the following error on import. Has anyone had success with this project? ( note I am using pyodbc in the meantime, but would like to eliminate the ODBC layer if possible ) Python 2.6.5 (r265:79359, Mar 24 2010, 01:32:55) [GCC 4.0.1 (Apple Inc. build 5493)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import

pipenv如何针对不同平台使用同一功能扩展包

夙愿已清 提交于 2019-12-21 01:10:45
场景 在Windows下开发的Python应用程序时,有些扩展包不能直接安装,需要从第三方下载编译好的扩展包导入安装。而对于Linux系统来说,可以直接pip安装。 那么如何解决不同平台使用不同的安装扩展包呢,除了编写两个 requirement.txt 文件以外。还可以使用pipenv工具,在Pipfile文件里做一些配置。之后一句命令 pipenv install 即可。 解决方案 下面以 pymssql 为例,pymssql Windows扩展包我已经提前下载好并放在 install/ 目录下。(下载地址:https://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql) 一般来说,输入下面命令行即可自动安装whl文件: pipenv install ./install/pymssql-2.1.4-cp36-cp36m-win_amd64.whl 而Linux可以直接安装: pipenv install pymssql 因此,我们需要修改Pipfile配置,为避免pymssql名称重复,修改Windows下的pymssql的扩展包为 pymssql-win,然后使用 os_name 判断系统。 Pipfile示例: [[source]] name = "pypi" url = "https://mirrors.aliyun.com

pymssql: How to use windows authentication when running on a non-windows box

旧街凉风 提交于 2019-12-20 20:42:26
问题 Is there a way for python to connect to MS SQL Server using Windows Authentication , even when not running the python app on a windows box ? I'm trying to do this with pymssql, but the examples mostly seem to assume that you're running on windows. If there is a way to make this connection using some other library, please feel free to suggest, but I do like how pymssql is simple to install and deploy via pip. I want to connect to 2005/2008 databases, and I'm running Ubuntu 13.04 (but I can

Insert binary file into MSSQL db (varbinary) with python pymssql

安稳与你 提交于 2019-12-19 04:14:25
问题 I'm trying to insert binary data into an MSSQL database using stored procedures from within an pyramid web application using pymssql. The MSSQL datatype for the respective column is varbinary(max) . My question is: What does the varbinary datatype of the MSSQL database expect me to do with the binary file before inserting it? Here's what I've been trying: with open(tmp_file, 'rb') as content_file: filecontent = content_file.read() ... and then pass the value of filecontent to the stored