Category "sql-server"

Most current price based on effective date

I am using SQL Server Management Studio and want to show the most current price for every day in a date calendar table. There are two tables: the Calendar table

There is already an object named 'Id' in the database. Could not create constraint or index

im using EF core 3.1 and trying to Update-Database after adding migration, but im getting this error "There is already an object named 'Id' in the database. Cou

Best Method to Delete 12M rows from SQL table

I have a table currently with 100M+ rows of telemetry data. The table often receives duplicate records. I can identify duplicate records using a row_number() pa

Node.js MS SQL transaction

Can anyone help to implement MS SQL transactions in Node.js . I am try to execute multiple stored procedures inside a promise. Method 1 const executeProcedure =

ParquetSharp's UTC adjustment

I am trying to use the ParquetSharp library (https://github.com/G-Research/ParquetSharp) to write some Parquet files from an SQL server database. As the origina

Getting previous month of last year

I want to get the previous month data but of the following year. So if it's May 2022, I want the data for April 2021. Here is what I currently have, but it is s

Getting previous month of last year

I want to get the previous month data but of the following year. So if it's May 2022, I want the data for April 2021. Here is what I currently have, but it is s

Is there a free version of SQL server that has Integration Services Catalog too?

Trying to understand what free version of sql server allows to create Integration Services Catalog for SSIS pacakges. Any help is appreciated. Thanks.

I need to merge data from one table to another, but I have one value that comes from a different table

This is my code MERGE OrderDetailsStructure AS Target USING SalesOrderData AS Source ON Source.WebOrderNo=Target.WebOrderNo WHEN NOT MATCHED BY TARGET THEN INSE

Unable to download SQL Server on M1 Mac

I have been trying to download SQL Server on my Mac with an Apple Chip. I've been following the steps that include downloading docker and entering code into my

How to upload whole Excel range of data to SQL server using VBA (without Wizards or looping row by row)?

I am trying to upload a range of data in excel (same structure as target SQL table) to a table in SQL server using VBA. I do not want to loop row by row but tra

which is best using delete or truncate when i need to delete all data from table?

I work on sql server 2017 I need to delete all rows from table student_course but I don't know which is best for use delete from student_course OR truncate tab

Subscriptions are not creating in the report server database

I have written the code to create the subscriptions by adding the reference to ReportService2010.asmx. Please see the below screenshot for code and result [Id =

Using NEWID() when explicitly inserting a value for an ID (key) column mutates ID values for other previously existing rows in the same table

I have a SQL Server database which is maintain through Entity Framework Core. Every time I need a change of the database schema, I just generate a new migration

Is there a definitive list of the MS SQL Server functionality that is incompatible with Transactional Replication

I'm running a SQL Server system (SS2019), which currently uses Merge Replication, and is about to be converted to using Transactional Replication. I'm (painfull

In SQL, how do I filter a parent with its child records if either satisfies a condition

I have the following table as example. I want to retrieve only the records where the ScheduleDate is smaller than 2022-01-03 (Jan 3, 2022) for either the parent

Implement an SQL query in LINQ

I'm trying implement the follow query in LINQ, but I don't find solution: SQL: SELECT COUNT(*) AS AmountMonths FROM (SELECT SUBSTRING(CONVERT(NVARCHAR(12), pay_

SQL Group/Orderby

I have a set of records in a db table like this. The thing that logically links these records is guid1 and guid2 but not all records in the table have a full re

How to store attachment file in an email in a database?

I used this code to store attachment xlsx files from a specific address email in Outlook, but now I would like to store these files in a database in SQL Server,

error :- ProgrammingError: Attempt to use a closed connection

hi all im trying to run a stored procedure using python however im getting an error below is my code import pyodbc import sqlalchemy from urllib.parse import qu