Use this tag for questions specific to the 2017 version of Microsoft's SQL Server.
Questions tagged [sql-server-2017]
1512 questions
63
votes
4 answers
Produce DISTINCT values in STRING_AGG
I'm using the STRING_AGG function in SQL Server 2017. I'd like to create the same effect as COUNT(DISTINCT ). I tried STRING_AGG(DISTINCT ,',') but that is not legal syntax.
I'd like to know if there is a T-SQL work-around. Here…

Brent Arias
- 29,277
- 40
- 133
- 234
53
votes
8 answers
Get unique values using STRING_AGG in SQL Server
The following query returns the results shown below:
SELECT
ProjectID, newID.value
FROM
[dbo].[Data] WITH(NOLOCK)
CROSS APPLY
STRING_SPLIT([bID],';') AS newID
WHERE
newID.value IN ('O95833', 'Q96NY7-2')
Results:
ProjectID …

gkoul
- 1,067
- 1
- 10
- 19
33
votes
2 answers
How do I find running Traces in SQL Server?
Is there an easy way to determine what traces have been set up by sp_trace_create on SQL Server 2000? How about for SQL Server 2005, 2008, 2012, or 2014?

GordyII
- 7,067
- 16
- 51
- 69
23
votes
3 answers
CLR Strict Security on SQL Server 2017
MSDN on this article says:
CLR uses Code Access Security (CAS) in the .NET Framework, which is no
longer supported as a security boundary. A CLR assembly created with
PERMISSION_SET = SAFE may be able to access external system resources,
call…

Jesús López
- 8,338
- 7
- 40
- 66
18
votes
1 answer
STRING_AGG not behaving as expected
I have the following query:
WITH cteCountryLanguageMapping AS (
SELECT * FROM (
VALUES
('Spain', 'English'),
('Spain', 'Spanish'),
('Sweden', 'English'),
('Switzerland', 'English'),
…

Tom Hunter
- 5,714
- 10
- 51
- 76
17
votes
4 answers
Unable to create the tSQLtCLR assembly in SQL Server 2017
I recently installed SQL Server 2017 Express and localdb (general availablity). While attempting to install the tSQLt framework I've discovered a new security feature implemented in SQL Server 2017: the "clr strict security" option. This new…

Brent
- 173
- 1
- 1
- 5
16
votes
2 answers
SQL Server 2014 installation stuck (hung up) or taking very long time to finish
I'm trying to install SQL Server 2014 but it stays in the same spot (Install_VCRuntime_Cpu32_Action) for hours. It's already the third time I'm trying to install so I don't know what else to do.
SQL Server 2014 Installation

Holydead
- 175
- 1
- 1
- 11
15
votes
1 answer
How to solve 'Cannot authenticate using Kerberos' issue doing EF Core database scaffolding in Linux(Ubuntu 18.04)? Are there any solutions?
everyone. I've been trying to develop simple starting AspNetCore application with EntityFrameworkCore to connect and work with MS SQL server database. And manage all this by Rider IDE, tool for Database client(DBeaver) and dotnet command line…

paulokunev
- 155
- 1
- 1
- 8
15
votes
6 answers
Error when installing SSDT (SQL Server Data Tools)
I have a problem during the installation of SQL Server Data Tools for Visual Studio 2017
I get the following error (translated):
The requested meta file operation is not supported (0x800707D3)
Screenshot: See here
Log file available…

Edwin
- 151
- 1
- 1
- 4
14
votes
3 answers
SQL Convert Milliseconds to Days, Hours, Minutes
I need convert a millisecond value, 85605304.3587 to a value like 0d 18h 21m.
No idea on how to start that, is there something similar to a TimeSpan in SQL like there is in C#?

sd_dracula
- 3,796
- 28
- 87
- 158
13
votes
2 answers
How can I keep SSMS Find and replace in files "Look In" from changing
In SSMS when I do a
Find and Replace in Files
(default keystroke CTRL+SHIFT+H)
Edit > Find and Replace > Replace in Files
If I set the "Look In" to "Current Document" then do a change and select the Replace All button, the Look In dropdown…

Mark Schultheiss
- 32,614
- 12
- 69
- 100
11
votes
3 answers
Preserve start points in UnionAggregate
Use case 1:
DECLARE @Geom TABLE
(
shape geometry,
shapeType nvarchar(50)
);
INSERT INTO @Geom(shape,shapeType)
VALUES('LINESTRING(1 2, 3 4)', 'A'),
('LINESTRING(3.2 4, 7 8)', 'B');
SELECT *
FROM @Geom
SELECT…

ParoX
- 5,685
- 23
- 81
- 152
11
votes
2 answers
How do I connect to SQL Server 2017 LocalDB?
I've been using (localdb)\ProjectsV13 as part of my VS 2017 installation, however, I recently needed to access some SQL Server 2017 features during development, so I installed SQL Server 2017 LocalDB as well (not part of VS installer still…

kspearrin
- 10,238
- 9
- 53
- 82
11
votes
3 answers
How to export SSRS 2017 report using REST API
I've setup SSRS 2017.I need to export an SSRS report using their new REST API, I've been looking through the API specification here but I can't find a method in swagger specification to render/export that report using an HTTP client.
This Question…

Aarif
- 1,595
- 3
- 17
- 29
11
votes
3 answers
New SQL Server Installation - Attempted to perform an unauthorized operation
I have a new Windows 10 Home machine and I want to install SQL server. I already have Visual Studio 2017 installed and SSMS 2017 (Which I initially though installed SQL).
On first try I got this error:
VS Shell installation has failed with exit…

Lex Eichner
- 1,056
- 3
- 10
- 35