Questions tagged [sql-server-2019]

Use this tag for questions specific to the 2019 version of Microsoft's SQL Server.

New Features Of SQL Server 2019

  1. Intelligent Query Processing Enhancements enter image description here
  2. Accelerated Database Recovery (ADR) enter image description here
  3. AlwaysEncrypted With Secure Enclaves enter image description here
  4. Memory-Optimized Tempdb Metadata
  5. Query Store Custom Capture Policies
  6. Verbose Truncation Warnings
  7. Resumable Index Build
  8. Data Virtualization With Polybase enter image description here
  9. Last Actual Execution Plan DMF
  10. Multiple Internal Performance Improvements

Reference : What's new in SQL Server 2019 (15.x)

977 questions
-2
votes
2 answers

SQL Add Medication days and find gaps

I need add the days of medication for people over the course of a year and determine how many days were covered by medication. This is similar to a Gaps and Islands problem except that people don't wait till the last day of their previous…
Hannover Fist
  • 10,393
  • 1
  • 18
  • 39
-2
votes
3 answers

SQL search entire database for partial datetime return

I'm trying to search an entire database for all returns of a specific date. I've used the code below however its not picking up the column I expected. The table column with the data is a datetime column, and the specific value contained is…
Richard
  • 11
  • 3
-2
votes
1 answer

SQL Server 2019 - a cross-database inner join correlation issue that didnt exist in sql 2000 - how to overcome - permission issue?

I have seen this question before, but aside from it being a few years old and the answer not really being SQL Server related (looks like MySQL) Im hoping someone can provide perhaps a database-option that allows it as it runs perfectly fine on SQL…
Carl Harrison
  • 145
  • 13
-2
votes
3 answers

convert datetime field to int in sql

my date column value looks like: 2023-04-23 00:00:00 2023-04-23 00:50:00 '' NULL I want to convert it to 20230423000000 20230423005000 '' NULL When I used Select FORMAT (DAT,'yyyyMMddHHmmss' from table give error as Argument datatype nvarchar is…
-2
votes
2 answers

Convert comma separated values and join with different tables in Microsoft SQL 2019

There are three tables and column have comma separated values as shown below: In table 1 there is a single value(TableValue1) and some values needs to get it from table2(Table2Name1 - get values on basis of name in table 2). In table 3 there is a…
Posting
  • 1
  • 1
-2
votes
1 answer

How to alter the same table on 2 SQL Servers with DDL trigger

I have createed an archive SQL database for some tables. I have one production server and one archive server (the archived database only has a few tables that I archived). Now I'm searching for an option when we deploy a new version for the…
-2
votes
2 answers

STRING_SPLIT -Query is adding more lines rather then allocating serial number in sequence

I am trying to split Serial No of a order item table , which has string separated values. I am able to separate the value but serial no allocation is not happening correctly, Its just showing additional rows. Table has data like OrderID OrderItemID…
S B
  • 519
  • 1
  • 4
  • 10
-2
votes
1 answer

How to aggregate values for a row staring from that particular row

I have a table like below : ID VALUE 1 200 2 300 3 100 4 50 5 1000 6 20 I want a row level sum for each row. Like for ID 1,it should be the sum of VALUEs from ID 1 to 6 , for ID 2 it should be 2 to 6 and like this . My desired…
Sayandip Ghatak
  • 191
  • 2
  • 14
-2
votes
1 answer

How to see queries executed in SQL Server Management Studio

I wonder if there is a way in SQL Server Management Studio to see the queries in T-SQL that have been executed in that background when we create or edit something using only the graphical interface . For example if I click create database using the…
Karim El
  • 3
  • 3
-2
votes
1 answer

Convert Columns into Multiple Rows

I am trying to get data from multiple columns into multiple rows. Sample data: DName FP1 FP1% FP2 FP2% FP3 FP3% DP1 DP1% DP2 DP2% Value Deliv_1 Dig 50 Port 25 Risk 25 Core 50 Imp 50 10000 Deliv_2 Imp 50 Port 25 Cor 25 …
peter
  • 2,396
  • 6
  • 24
  • 29
-2
votes
2 answers

How to do calculations and then compare them in SQL Server

I have a table with columns Recordnumber, Test, Value, Date and Complement. Recordnumber and test are the primary key. I need compare values from TW01SS and TW01D1+TW01D2 with the same Recordnumber and depending on which value is bigger add it to…
-2
votes
1 answer

Convert mixed format string datetime value to datetime datatype

SQL Server 2019 is receiving data from upstream PostgreSQL. The four date columns are defined as datatype Varchar(50) and hold datetime values like this: 2021-12-09 09:16:09+00 2021-12-15T02:40:39+01:00 2021-12-15 1:27:56 2021-12-15 0:45:00 How can…
Aryan
  • 57
  • 5
-2
votes
1 answer

Date Type Issue on Datetime and Text Using BulkInsert

I have a dataset more than 1000 when import into SSMS. Thus I use the following T-SQL to create table and import data: CREATE TABLE sales( SPID text, GeoID text, PID text, SaleDate smalldatetime, Amount int, Customers int, Boxes…
Azul
  • 25
  • 8
-2
votes
1 answer

Can I do a Partial Cascade Update on a Foreign Key Field Using INSTEAD OF UPDATE Trigger?

The Challenge is that, when I change the name of One of My Retail Shop I want for the Sales Table: RetailName to stay the Deleted name (I mean the Changed Name) for records with previous months Sales Date and RetailName to be the New Inserted Name…
Meshka
  • 1
  • 2
-2
votes
1 answer

Optimizing the Sql Server 2019 Query [ About Categories with Id and ParentId Relation using single column in table]

How can i optimize the Sql Server Query Table name is: Pro_itemmaster Column name is: itm_Code Test Data = Download Link My Query take 17 seconds to complete Query ; WITH CatItem AS( SELECT PIM.itm_Code AS Id ,CASE WHEN…