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
-1
votes
1 answer

Searching most used product in sale table using structure query language

I am searching "Which product is the most popular one (i.e., most customers purchased it)?" I tired many sql command but i failed to search the most purchased product name in sale table. Description(nvarchar) and quantity(float).
Jamshed Salik
  • 19
  • 1
  • 2
  • 9
-1
votes
2 answers

What is the correct pattern matching string to exclude records containing "x"

DECLARE @data TABLE ( sample_text VARCHAR(20)) DECLARE @match TABLE ( match_text VARCHAR(20), return_value INT ) INSERT INTO @data VALUES ('sample'), ('text'), ('fuzzy'), ('kittens') INSERT INTO @match VALUES ('%e%',…
G B
  • 1,412
  • 10
  • 12
-1
votes
1 answer

SPLIT_STRING to get first or second part

I am stuck searching for a way to do the following. I have a simple table which looks +-------------------+----------+----------+ | coord | lat | lng | +-------------------+----------+----------+ | 9.08273, 10.92773 | …
SEKTOR 8
  • 23
  • 4
-1
votes
2 answers

Syntax for ending Procedure creation in SQL server

I want to create a temporary procedure in a Begin-End-Block and after that run the procedure with different parameters. I have to do this because i dont want to create lasting procedures on the server but i have some problems to get the syntax…
HrkBrkkl
  • 613
  • 5
  • 22
-1
votes
1 answer

Extract number before and after character

I need to extract a certain number from my 'TblA' from column 'Input' in sql. I have the following example input and desired output 1 and 2. Input Desired Output 1 Desired Output 2 20 x 88 nc. 20 88 100 x 300 nc 100 300 200x 88…
Zayfaya83
  • 93
  • 6
-1
votes
1 answer

How to convert a string to a date typ with the stylecode 104?

I have a string '11.12.2020' but how to convert it to date but with the same style 11.12.2020. I know there are the format function, but I heard it need a lot of processing power and format convert the date back to string. I tried the code (see…
Mail
  • 1
  • 2
-1
votes
1 answer

Get individual data from a string of data with comma separated using C# and SQL Server 2019

I have a table like this CREATE TABLE Employee ( [EmployeeId] int, [EmployeeName] varchar(100), [ClassId] nvarchar(MAX) ); with sample data like this: EmployeeId EmployeeName ClassId ----------------------------------- 1 …
-1
votes
1 answer

Microsoft SQL Server 2019 on linux always on pcs status error

This is a newly deployed environment and an error has been reported after executing the following command pcs resource create sqlag ocf:mssql:ag ag_name=sqlag master notify=true pcs resource create AVGListener ocf:heartbeat:IPaddr2…
-1
votes
1 answer

SQL Server :: Replication Distribution Agent never ending

I'm running SQL Server 2019 Always ON Availability Group with an asynchronous replication. I use a free tool called IDERA SQL Check and I have spotted the SPID 69 which program name is Replication Distribution Agent. It's always there, staring at me…
-1
votes
1 answer

SQL Server 2019 - archive remote DB daily with archive date in each table

I am very new to SQL and was hoping for some help. I have a database that is hosted remotely and I want to take a snapshot of all the views and archive them in a local 2019 database daily with an 'archived' date field in each of the local tables. So…
S.Carter
  • 21
  • 6
-1
votes
1 answer

Create nested empty Json objects

I want to create the nested empty Json objects. I tried for one layer using JSON_Query('[]'). But how to do for nested objects? Expected output should be: { "Model": [ { "ModelName": "Registration", "Student": [ …
Ashok Yaganti
  • 173
  • 5
  • 14
-1
votes
2 answers

SQL Server Left Join producing duplicates

I have 3 tables, Budgets, Income, and Expenses. Budget table: Income table: Expenses table: This is my SQL statement: SELECT Budgets.BudgetID, Budgets.BudgetName, Budgets.Username_FK, Budgets.BudgetAmount, Budgets.SavePercentage, …
anonymous23
  • 55
  • 2
  • 9
-2
votes
0 answers

Select case when exists between two tables

Table1 workorderno EGR98765432100 EGR65449873210 EGR32165232321 Table2 workorderno EGR98760000000 EGR65449873210 EGR32162223111 Table1 workorderno ReportItem EGR98765432100 No EGR65449873210 Yes EGR32165232…
Ray
  • 11
  • 3
-2
votes
1 answer

Extract date with varying length from text string

When my data in field1 is formatted consistently as mm/dd/yy, I can extract the date using this: substring([field1],patindex('%[0-9][0-9]/[0-9][0-9]/[0-9][0-9]%',[field1]),8) However, sometimes it comes in with only one digit for the day and/or…
Sam Cohen-Devries
  • 2,025
  • 2
  • 18
  • 35
-2
votes
0 answers

How to use LAG & LEAD FUNCTION in SQL SERVER 2008

i code query on SQL Server 2019. I have problem about Lead & Lag on SQL Server 2008. Here my query. SELECT DAT_PASIEN, REG_KUNJUNGANPASIEN, TGL_REGISTRASI, LEAD(TGL_REGISTRASI) OVER (ORDER BY TGL_REGISTRASI DESC) NEXT_TGL_REGISTRASI, …