I have a time series plc tag data as below with values in ‘1’ or ‘0’ Using below code I can get the output Output But my requirement is, I only want to query going back 25 hours, so I add a predicate: But this returns the error: Msg 209 Level 16 State 1 Ambiguous column name ‘datetime’. Answer You
Tag: sql-server
Database connection broken even with with SQLAlchemy pre-ping
Since I moved my database from a mssql docker container to an azure database as a service my web application( flask) is being disconnected after several minutes. It is simply solved by a refresh of the page but still, there is an issue here. The error raised by SQLAlchemy is an Operational Error (https://docs.sqlalchemy.org/en/14/errors.html#error-e3q8) I tried to implement the pool_pre_ping=True
Table get locked when called an SQL Server SP from pyodbc Python [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 1 year ago. Improve this question Table get locked when called an SQL Server SP from pyodbc Python I have a table I made for testing called test. I just want
How To Prevent Fast Execute Many Giving Truncation Error
Not sure how to reproduce this as I’m not sure what is causing the issue in the first place, however, I have the currently line of code which writes data to an SQL Server Table. However I get the following error: I have checked the sql server and see that varchar has been set to -1 which indicates that the
Is it possible to set a jupyter notebook chunk to run with a certain delay after the previous one?
I have the following 2 chunks. Once the first chunk gets executed in python it seems to me that it takes time for the stored procedure to execute in sql. Before that is done, however, python moves immediately to next chunk. Is it possible to delay running of the next chunk by say 5 minutes? Answer I’m not sure if
DataFrame comparison with SQL Server table and upload just the differences
I have an SQL table (table_1) that contains data, and I have a Python script that reads a csf and creates a dataframe. I want to compare the dataframe with the SQL table data and then insert the missing data from the dataframe into the SQL table. I went around and read this comparing pandas dataframe with sqlite table via
Display image from SQL DB in QLabel
The database stores images in varbinary format. I am getting data like this b’xffxd8xffxe0x00x10JFIFx00x01x01x01x00x00x00x00xffxe1x00ZExifx… I can save them if I use the code I don’t want to save pictures, i want show them directly in QLabel. How can i do this? Answer I finded solution for my problem.
Unable to open pandas python package from Azure Data Studio, while configuring SQL Server 2019 Big Data Cluster
I’m working on setting up SQL Server 2019 Big Data Cluster. One of the initial steps is installing python package: panda. Post installation, when I try to import the package, I get the following exception in Azure Data Studio. import pandas ModuleNotFoundError: No module named ‘pandas’ I don’t get this exception, when I load the package from command-prompt/python. This could
Scan a single column in SQL Server for a data entry using python
Example of a column: This is what I have tried. I only want to search based on a single column in the table. Lets says the table name is Employees. The input parameter is entered by the user in console. Answer I think this is what you are looking for:
Delete sql table rows from python
I can successfully connect my python notebook with sql server this way : Let’s take this sample dataframe : I have a sql table with the same columns, named table_name. Objective : I want to delete in table_name all the rows where a row in df has the same Name, same Date, same Status, and Max = 0 (only in