Skip to content
Advertisement

Tag: sql-server

Sqlalchemy in-memory database for MSSQL

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

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

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

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,

Advertisement