Questions tagged [pymssql]

A discontinued interface for Python that provided a standard Python DB-API interface to Microsoft SQL Server.

Pymssql was an interface for Python that provided a standard Python DB-API (as defined by PEP 249) interface to Microsoft SQL server. It was discontinued in November 2019.

Related tags:

621 questions
-1
votes
1 answer

PYODBC script to do an insert if row doesn’t exist and update if row exists already

I am trying to do an upsert in the SQL Server table using PYODBC. Please find the code below: sql_insert = """ UPDATE qch_FullCaseList SET [DecisionDate]=?, [CaseName]=?, [FileNum]=?, [CourtLocation]=?, [CourtName]=?, …
PythonKS
  • 3
  • 3
-1
votes
1 answer

SQL SELECT WHERE Col value is = string

I currently have the following T-SQL statement in my python code: otherExpense ='SELECT Master_Sub_Account, Debit, Credit FROM [dbo].[PostGL] as gl'\ 'INNER JOIN Accounts '\ 'ON Accounts.AccountLink = genLedger.AccountLink '\ …
KyleStranger
  • 233
  • 3
  • 20
-1
votes
1 answer

FileNotFoundError ! using Python

i was able to connect to an external db but while trying to generate a qr code from the result i'm getting this error. import pymssql, pandas as pd, openpyxl, pyqrcode, os QRCode(content=b'0001-87L58/1', error='H', version=2,…
Shegmatech
  • 1
  • 1
  • 2
-1
votes
2 answers

How can I create multiple connections with pymssql?

I am trying to create a table via pymssql, but I am getting the error: InterfaceError: Connection is closed. I have already tried to put the CREATE TABLE statement into the same connection with the SELECT statement, but when I did this no Table was…
gython
  • 865
  • 4
  • 18
-1
votes
1 answer

Unable to connect to SQL server from linux pyodbc

Below is the error while connecting to SQL server from linux: connection = pyodbc.connect(connect_string) pyodbc.Error: ('01000', u"[01000] [unixODBC][Driver Manager]Can't open lib /usr/local/lib/libmsodbcsql.17.dylib' : file not found (0)…
-1
votes
1 answer

How to use WEEK and DAYOFWEEK functions in SQL Server

I have a simple code written in MySQL which returns the week number based on specific date: Is there any equivalent in SQL Server? I was trying to use it by none function works WEEK(ADDDATE(date,5-DAYOFWEEK(date)),3)
akaribi
  • 57
  • 3
-1
votes
3 answers

UnicodeDecodeError in pymssql library of Python

I'm using pymssql to get some data from the SQL server and store the results in a pandas dataframe. When I try to select a column that contains utf-8 (Farsi) characters, I get this error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0xca in…
Saeed Esmaili
  • 764
  • 3
  • 12
  • 34
-1
votes
1 answer

AWS lambda pymssql error connecting to local database

I am creating an Alexa skill to get some information from my local database on request. I have SQLServer 2008 running and I can use the pymssql library to pull data when I run my code locally. However after deploying it with AWS, I see the following…
s_om
  • 661
  • 2
  • 9
  • 24
-1
votes
1 answer

Installing pymsql on windows 8.1

I've installed Python 3.6.4 on Windows 8.1 64-bit. I have it on system environment variables path as: C:\Users\myuser\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Python 3.6 The command python works in any location with command line so the…
Steve Waters
  • 3,348
  • 9
  • 54
  • 94
-1
votes
1 answer

pymssql, can't execute EXEC command sql

i'm trying to execute this type of sql command with python but that doesn't work import pymssql _conn = pymssql.connect(** SQL parameter) _cur = _conn.cursor() _cur.execute("EXEC(SELECT * something)") i got this error. Thanks.
-1
votes
1 answer

"type 'NoneType' is not iterable" error when calling pymssql.connect

I have SQL Server installed on my computer, on the same computer I try to connect to the database using python, but I get the following error: >>> from os import getenv >>> import pymssql >>> server = getenv(“КОМП”) >>> user = getenv(“user”) >>>…
Molodoy
  • 1
  • 1
-1
votes
1 answer

Have to restart apache server to display data from SQL Server in Flask

I have setup a Flask app on a VPS and everything seems to work fine; When i restart apache everything works fine and i got this: html table if I reload the browser page the data disappear and only remains the table header; if I want to see again the…
-1
votes
1 answer

comparing an int variable to MSSQL query results Python via pymssql

I'm trying to compare a variable to query results in the following which are dates in yyyymmdd format. The database field LastUpdate is of type int. When I test this, I think I am getting the false result because the query is a tuple compared to my…
bassmann
  • 250
  • 3
  • 18
-1
votes
1 answer

SQL Server: How to combine rows

I have a query like select top 10 Col1,Col2,Col3 from tab1 which gives me (1, 1, 1) (5, 2, 59) (8, 3, 69) (9, 4, 70) (10, 5, 71) (11, 6, 72) (11, 7, 73) (11, 8, 74) (11, 9, 75) (11, 10, 76) i want to condense the result as (1, 1, 1) (5,…
AbtPst
  • 7,778
  • 17
  • 91
  • 172
-1
votes
1 answer

Where can I find the PYMSSQL Module with a .py extension?

I am looking for PYMSSQL to interact with a MS SQL Server on a remote location. This is very irritation because I previously installed PYMSSQL (found online in .py format), but cannot find it anymore. Any help would be greatly appreciated! I have…
Phil
  • 73
  • 3
  • 9
1 2 3
41
42