Questions tagged [sql-server-2017]
Use this tag for questions specific to the 2017 version of Microsoft's SQL Server.
sql-server-2017
1,523
questions
0
votes
1
answer
76
views
How to ensure use of an index?
I have the following query:
SELECT cp.ID_Case
FROM dbo.CaseParty cp (NOLOCK)
JOIN dbo.Client cli (NOLOCK) ON CASE
WHEN cli.ClientType = 'atty' AND cp.ID_ClientAttorney = cli.ID_Client THEN 1
...
0
votes
0
answers
33
views
Trouble installing multiple instances of SQL Server 2017
I already have one SQL Server instance installed with several databases, and am attempting to create install more to create additional development environments (edit: developing with .NET).
Following ...
1
vote
1
answer
60
views
Split Invoice Total into multiple Rows but Split always equals Total
Create Table #Invoices
(
InvoiceID int,
Amount money,
ProjectID int
)
insert into #Invoices
(
InvoiceID,
Amount,
ProjectID
)
select
1,
100,
1
union all
select
...
-1
votes
2
answers
56
views
Retrieving Non Null Values Query, returns the previous previous value instead
I've written the following query, which for OccupancyID 182 returns the correct values. However for OccupancyID 3313 with a date of 2024-03-01, it returns 150015 rather than 100812.
The query is ...
-1
votes
1
answer
49
views
Continue record sequence in blank months until another record appears
I have a table that continues Client IDs and records a score based on their result. What I'm struggling with is I need to show the scores by month, but carry over scores from previous months where the ...
0
votes
0
answers
58
views
SQL Server xp_cmdshell process wont end with KILL command
On a SQL Server instance (Microsoft SQL Server 2017 (RTM-CU31)), I have a job that calls a Python script that makes an API call to return data. This job now and again stops processing (no increase in ...
0
votes
1
answer
34
views
Triggers for checking complex uniqueness for table with soft deletes
I have a table that contains information about permits for various regions.
It has unique identity primary key, and a two column unique key which is the application's permit number and the region ID.
...
0
votes
1
answer
49
views
Returning XML Data in Tabular format when it isn't stored as XML
I have this XML data stored in a varchar(8000) column in a SQL Table, unfortunately not as an XML column.
<?xml version="1.0" encoding="utf-16"?>
<ArrayOfRate xmlns:xsi=&...
0
votes
0
answers
18
views
Does Model Package Editor from Master Data Services have a limit on the Size of package you can edit?
I am trying to use the Model Package Editor wizard in SQL Server 2017.
It works fine for smaller packages and I am able to select the relevant objects that I want to keep in my package. the largest I ...
0
votes
0
answers
63
views
Create DB audit specification without ALTER ANY DATABASE AUDIT
SQL Server doc, topic Create Database Audit Specification, on Sub-topic Permissions, says:
Users who have the ALTER ANY DATABASE AUDIT permission can create database audit specifications and bind ...
0
votes
0
answers
168
views
Stored procedure default value output parameter is ignored? [duplicate]
I have this simple procedure where I don't quite understand the behavior.
I want my procedure to return a default value if no other value is assigned to it.
CREATE PROCEDURE [dbo].[Test]
@...
-1
votes
1
answer
123
views
Remove duplicate values in JSON Array
I have this value in a field of a SQL Server Table:
["I3","I23","B1","B3","B2","B4","B6","I1","I11","I4&...
0
votes
1
answer
42
views
Excel dates stored in SQL Table in Decimal format - convert back to dates
I have a Power Automate flow that is reading from Excel, and is storing date values in a SQL table.
29/03/2023 is being stored as 45014.75, and 17/10/2023 is being stored as 45216.3958333333.
Does ...
16
votes
2
answers
4k
views
Entity Framework Core 8 Where IN vs Where IN OPENJSON
EF Core 8 now inlines values in where statements using a combination of WHERE IN and OPENJSON as opposed to the previous WHERE IN(...).
This change is noted in the documentation and the stated reason ...
4
votes
1
answer
216
views
What is the purpose of setting a calculated column to be PERSISTED?
My table with the calcIncome calculated column:
CREATE TABLE foo
(
id int,
name varchar(100),
[other columns],
calcIncome AS dbo.fn_calcIncome() PERSISTED NOT NULL
)
Query:
select * ...