I’m trying to setup tests for my project and want to use an in memory database for those tests. Based on some examples I found online I’ve been able to get an in memory sqlite database working… The problem I have is my models are all based around MSSQL (that’s what the ‘real’ code is using) so I get E
Tag: sql-server
Django change upgrade MSSQL database
I have a Django app that was running without any problem with SQL server 2008, I have an issue like this after I upgraded the MS SQL server 2008 into 2019. I didn’t change anything in the code but when I’m calling the DB, I face this error: 42000′, ‘[42000] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Cannot find either column
Python Django REST Infinite Recursion Problem
As of late I’ve started working towards learning REST Api with Django Rest Framework, Cors headers, and mssql connector both for personal purposes, and for a project I’m working on. Beneath I’ll include snippets of code and or the errors I got to make this easier to digest. Working with this project, I got close to completing a Get/Post/Put method,
Python re.findall regex and text processing
I’m looking to find and modify some sql syntax around the convert function. I want basically any convert(A,B) or CONVERT(A,B) in all my files to be selected and converted to B::A. So far I tried selecting them with re.findall(r”bconvertb(.*?,.*)”, l, re.IGNORECASE) But it’s only returning a small selection out of what I want and I also have trouble actually manipulating
In Jupyter notebooks, how to connect to MS SQL with a different Windows user
I have Select access to a MS SQL database that I would like to extract data into a Pandas dataframe running inside a Jupyter notebook. For reasons out of my control, I have access to the database from a different user. How can I query the database from Jupyter while connected to my current user account? Answer This is how
Iterating over 2 lists in SQL execution using SQL Alchemy
I currently have this query: That I changed to use bindparams: So before, I was able to make the query per table in the bmds_stage_table list and change_set_ids was just 1 int But now change_set_ids is a list of ints. So now, for each change_set_id I want to iterate through all the tables in the bmds_stage_table list With the change
How can I Insert multiple rows with one query
I made a code allowing me to GET data from an API and insert it into a database. But I encounter a problem my api contains about 20 million data and to insert everything in my database it will take me 43 days :) I think the problem comes from the fact that I insert the data one by one.
Test Connection pyodbc (Python and SSMS)
I’m trying to follow some simple steps in this Microsoft doco but I can get it to connect. What am I doing wrong? This is the error message: PS C:UsersNelson.Silva> & Answer You changed your code before posting. In the code block you say the connect line is but in the exception block the line is: The problem is not
Python code doesn’t run the SQL stored procedure completely
I am not proficient in Python but I have written a python code that executes a stored procedure (SQL server) which within it contains multiple stored procedures therefore it usually takes 5 mins or so to run on SSMS. I can see the stored procedure runs halfway through without error when I run the Python code which makes me think
Django Azure SQL ProgrammingError Invalid Object name
I am trying to use Azure SQL with Django by using mssql-django. I get this error during “makemigrations”: django.db.utils.ProgrammingError: (’42S02′, “[42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Invalid object name ‘customer_group_customergroup’. (208) (SQLExecDirectW); [42S02] [Microsoft][ODBC Driver 17 for SQL Server][SQL Server]Statement(s) could not be prepared. (8180)”) The connection to Azure SQL is already working. If I start a new app,