pymssql

How to install pymssql on windows with python 2.7?

一世执手 提交于 2019-12-18 11:53:29
问题 It seems that there are no such binaries yet. There is an issue on googlecode: http://code.google.com/p/pymssql/issues/detail?id=12 but i cannot figure out what to do with those files provided. 回答1: You may also get pymssql2.7 library from this unofficial extensions library http://www.lfd.uci.edu/~gohlke/pythonlibs/#pymssql 回答2: If you have pip install: pip install pymssql To install pip (trust me its very helpful): Download and run this python script (as admin): https://bootstrap.pypa.io/get

How to configure pymssql with SSL support on Ubuntu?

蹲街弑〆低调 提交于 2019-12-17 06:14:43
问题 What were the steps required to configure (the now discontinued) pymssql with SSL support on Ubuntu so I can connect to a SQL Server instance that requires an encrypted connection (e.g., Azure)? 回答1: Ubuntu 16.04 LTS (See this answer for Ubuntu 18.04 LTS.) The following worked for me on a clean install of Xubuntu 16.04 LTS x64: The first challenge is that the FreeTDS we get from the Ubuntu 16.04 repositories does not support SSL "out of the box", so we need to build our own. Start by

tsql login failed but management studio can connect

纵饮孤独 提交于 2019-12-13 18:36:10
问题 I'm trying to connect to a MS SQL Server instance using tsql (to troubleshoot not being able to connect with django-pymssql). I can connect fine to the server (running on Amazon RDS, latest SQL Server version from on there) from a VM running SQL Server management studio, but from my native Ubuntu 15.10 env I get a login failed error. Using the following: tsql -H <hostname> -p 1433 -U <user> -P <mypassword> I get: locale is "en_GB.UTF-8" locale charset is "UTF-8" using default charset "UTF-8"

pymssql on Windows can connect to local SQL Server but not to Azure SQL

空扰寡人 提交于 2019-12-13 15:54:38
问题 Trying to connect to an Azure SQL DB (v12) using pymssql, I am able to connect query and write to my local MSSQL instance using pymssql. I am getting an "Adaptive Server connection failed" failed error and my research seems to point to FreeTDS, but I have not installed FreeTDS on my machine. Using the tsql utility, i am able to connect to the Azure SQL instance Why would I fail to connect using pymssql? pymssql connection string import pymssql conn = pymssql.connect(server='<severname>

stdout pymssql to variable

耗尽温柔 提交于 2019-12-13 02:16:48
问题 Im trying to retrieve the result form running import pymssql conn = pymssql.connect(server='IP', user='domain\user', password='PSWD', tds_version='8.0') cursor = conn.cursor() cursor.execute("EXEC msdb.dbo.sp_start_job @job_name = 'jobname'") when it add the job to the cue to process it wont return anything, but when the job wasn't runned it will return stuff like in a case for testing Traceback (most recent call last): File "shared/python3", line 85, in <module> cursor.execute("EXEC msdb.dbo

Is parameter binding implemented correctly in pymssql library?

∥☆過路亽.° 提交于 2019-12-12 16:55:53
问题 I'm calling extremely simple query from Python program using pymsqsql library. with self.conn.cursor() as cursor: cursor.execute('select extra_id from mytable where id = %d', id) extra_id = cursor.fetchone()[0] Note that parameter binding is used as described in pymssql documentation. One of the main goals of parameter binding is providing ability for DBMS engine to cache the query plan. I connected to MS SQL with Profiler and checked what queries are actually executed. It turned out that

Why can't apache see my python module?

霸气de小男生 提交于 2019-12-12 05:39:46
问题 I am running a Python 3.4 virtualenv on Ubuntu 14.04 with mod_wsgi in apache 2.4. For some reason, apache cannot see the pyodbc.cpython-34m.so module (which, of course, lacks a .py extension). The module is within my virtualenv site-packages directory with a cpython-34m.so extension: (python3env)user@vlinuxweb:/home/production_code/python3env/lib/python3.4/site-packages$ ls django pyasn1-0.1.8-py3.4.egg-info Django-1.7.8.dist-info __pycache__ django_mssql-1.7.dist-info pymssql-2.1.1-py3.4.egg

python to mssql encoding problem

无人久伴 提交于 2019-12-11 15:58:30
问题 Greetings By using pymssql library, I want to write data to a MSSQL database however I encounter encoding issues. Here is my sample code to write to the DB: # -*- coding: utf-8 -*- import _mssql .... Connection info data here .... def mssql_connect(): return _mssql.connect(server=HOST, user=USERNAME, password=PASS, database=DB, charset="utf-8") con = mssql_connect() INSERT_EX_SQL = "INSERT INTO myDatabsae (Id, ProgramName, ProgramDetail) VALUES (1, 'Test Characters ÜŞiçÇÖö', 'löşüIIğĞü');"

How to update a db table from pandas dataset with sqlalchemy

浪尽此生 提交于 2019-12-11 15:24:24
问题 I need to update a table in a MSSQL database. The dimension of the table doesn't allow to load the table in memory, modify the dataframe and rewrite it back. I also need to update only one column at a time so I cannot use the solution proposed in this topic (ie the solution proposes a delete operation of the interested rows, impossible for me cause I can update only one column at time) So I need to perform something like an update-from query Update mytable set mycolumn = dfcolumn from df

Create SQL Server temporary tables inside Python script

非 Y 不嫁゛ 提交于 2019-12-11 10:14:52
问题 I'm using pypyodbc to connect to the SQL Server. I want to store my resultset into a temporary table like we do in SQL. But everytime I try to do it - I get this error message: pypyodbc.ProgrammingError: ('24000', '[24000] [Microsoft][ODBC SQL Server Driver]Invalid cursor state') This is what I'm trying to query: querytest = "SELECT id into #temp from Team" cursor1.execute(querytest); var = cursor1.fetchall() print(var[:10]) 回答1: The query SELECT id into #temp from Team does not return a