Category "sql-server"

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

Best way to get Azure and local SQL Server development databases to sync on request

I'm looking for a one click system that doesn't require one to delete the Azure database, publish from the local server, and re-create the user info onto the de

What is the best way to get a decimal or a float result when dividing two numbers in SQL [duplicate]

I declared a variable @avgMis as a decimal(2,2) in SQL Server. Then I tried to divide two integers, expecting a decimal value. Instead my answ

Azure Data Factory Copy Task Creates Gap In IDs

I have an Azure DataFactory copy task set up to copy employee data from a MySQL database to a SQL Server database. The data copies over fine except for the fac

Getting duration is seconds between datetime rows in SSIS

I have an event-based csv file that logs an event along with the time of execution. I need to be able to get the duration between the events by taking the DateT

IIS with SQLLocalDB return null on queries with error in Windows Event viewer error 528

I am developing an ASP.NET website with a SQL Server 2019 LocalDB database. I was working in Windows 10 ver:1903, but after upgrading Windows to the latest vers

Saving Greek characters in varchar column using SQL Server 2019 _UTF8 collations

Background: I'm doing some proofing of SQL Server 2019's _UTF8 collations (ref. https://docs.microsoft.com/en-us/sql/relational-databases/collations/collation-a