Category "sql-server"

Sql determine rows that dont have value

I have a table that returns results like abc yes abc no cdef no cdef no cdef no xyz yes xyz no xyz no sample query with abc as( select 'abc' as b

SQL Query with 2 conditions but from different tables

I have the below query that has only one condition, which is if the companies are included in the table, then mark them as "Yes" under [Competitor] column, if t

How to prevent automatically rounding the decimal part of the number in .NET 6

After I converted the version from .NET Core 3.1 to 6.0, I figured out that all decimal(10, 5) type columns were automatically rounding the decimal part of the

SQL Server backup using powershell in Task scheduler

I am using PowerShell to backup a SQL Server database and use Windows task scheduler to schedule the script Test Run the script manually, it works. Both SQL Ser

SQL Error when using Order By for SQL database query in PowerBI Desktop

Getting this error when using Get Data with PowerBI Desktop to connect to SQL database Microsoft SQL: The ORDER BY clause is invalid in views, inline functions,

SSRS 2017 configuration and Installation

I have SSMS 2017 and VS 2019. I was trying to configure SSRS 2017. It says: The database engine instance you selected is not valid for this edition of report s

PK on temp table failing

I have a trigger which declares a table variable. DECLARE @TREarn_aaa table ( aaaID bigint NOT NULL PRIMARY KEY, Bbb decimal (18, 8) NULL, Ccc dec

Is there a faster way to find the order of a COLUMN?

My SQL Server table looks like this ID a_Toyota a_Mazda a_Nissan a_Kia a_Honda a_Subaru SoldCar CarOrder 1 8000 7000 6200

SQL question using PIVOT, no aggregation column

I would like to do a PIVOT on my table but I don't have aggregation column. SELECT CONVERT(date, DataHora) AS dia, CONVERT(VARCHAR(5), DataHora, 108) A

Inner join of an EXCEPT subquery on column names that do not appear in the output

I have a table of students and classes. I would like to find what classes were dropped from one semester to another (and a similar query for classes added). Stu

JSON with roots for every selected day

I am struggling with the problem with nesting root for every day (it's an element of my table). I'd like to get nested Key: value pair of day from table Day. He

How to get notifications using signal r based on selected value on client browser

Here is the code of server side i.e of NotificationHub where i intend to add some logic by which i get realtime update from database based on client send value

How can I add "TrustServerCertificate=Yes"; or "Encrypt=False;" to a SQL Server RDS in AWS?

While trying to run my migrations in a Laravel App I have in an EC2 server, I run into this error message. SQLSTATE[08001]: [Microsoft][ODBC Driver 18 for SQL

SQL doesn't accept my minimum date from C#

I use the layer2 cloud connector to sync between Sharepoint DB (right) and SQL Server database (left). I sync from right to left only. I make a dynamic column o

Want SQL statement to return all columns

Write a SELECT statement that returns the LastName, FirstName, and AnnualSalary columns of each instructor that has a unique annual salary. In other words, don

How do i create a specific one many view using Microsoft SQL Server

I have a master table and a detail table. Question 1: I would like my view to look like this master1 row, nulls master1 row, detail1 row for master1 master1 row

Get working days (Monday-Friday) and replace them with "between" in query

I have some query in which I am substituting 2 dates in a field "between". SELECT ... FROM ... WHERE o.EventDate between @startDate and @endDate How to make it

Append Changed and New Employees to Existing Table

I have a table (Table 1) which is a list of employees and data points about them. The data that populated Table 1 is regularly changed and added to in its sourc

SQL Server : select from stored procedure

Currently, this is the only way I know Create @tempTable1 Insert into @tempTable1 Exec mySP1 input1, input2 Create @tempTable2 Insert into @tempTable2

Eliminating NULL Values in SQL

I have a complex subquery within a query giving me this: Col 1 Col 2 value1 NULL NULL value2 value3 NULL NULL value4 value5 value5 But instead, I need this ou