Questions tagged [sql-server-2017]

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

1512 questions
7
votes
1 answer

Inline index definition fails when name is the same as table name

SQL Server objects i.e. tables and indexes have their own namespaces. So it is possible to have the same name for index and table(but it's not a common/good practice): CREATE TABLE t(id INT PRIMARY KEY, col INT); CREATE INDEX t ON t(col); SELECT *…
Lukasz Szozda
  • 162,964
  • 23
  • 234
  • 275
7
votes
1 answer

How to debug stored procedure on Microsoft SQL Server 2017?

I need to debug stored procedure on the local SQL Server using data stored in this server. I have on my device: Microsoft SQL Server 2017 Standard Microsoft SQL Server Management Studio 2014 Microsoft SQL Server Management Studio 18.0 Preview…
InfernumDeus
  • 1,185
  • 1
  • 11
  • 33
7
votes
1 answer

No source control option in SQL Server 2017 Management Studio

Screenshot above is from my SSMS 2017. I want begin to use tfs on SQL server and I googled how to use it and apparently there should be an option for source control in tools-->option but there is no option for source control. How can I fix it? I…
TheDeparted
  • 135
  • 1
  • 2
  • 11
7
votes
2 answers

Syntax for Entity Framework query to SQL Server 2017 Graph database

Assume I'm working with the graph database from this sample (SQL Server 2017): https://learn.microsoft.com/en-us/sql/relational-databases/graphs/sql-graph-sample I have the following SQL query: -- Find Restaurants that John likes SELECT…
gbdavid
  • 1,639
  • 18
  • 40
6
votes
1 answer

SQL Server machine learning services r version 3.5

According to this link, SQL Server machine learning service's highest R version is 3.3. Does anyone know when one can upgrade to version 3.5 or later? Or is my only option to switch to sql server 2019? Thanks.
cs0815
  • 16,751
  • 45
  • 136
  • 299
6
votes
3 answers

Due to error 0x80070057" The parameter is incorrect." SSIS job failed to run

I have a SSIS job which run well in SQL Server 2008 but no longer working in SQL Server 2017. The error message I get is: Cannot create a task from XML for Task "Email", type "Microsoft.Script.Task" due to error 0x80070057" The parameter is…
Hao
  • 103
  • 1
  • 2
  • 8
6
votes
2 answers

Get Lead value over multiple partitions

I have a problem that I feel could be solved using lag/lead + partitions but I can't wrap my head around it. Clients are invited to participate in research-projects every two years (aprox.). A number of clients is selected for each project. Some…
Henrov
  • 1,610
  • 1
  • 24
  • 52
6
votes
4 answers

Fill in gaps in data, using a value proportional to the gap distance to data from the surrounding rows?

At some point soon I'll have to prepare a list of prices of items on days. The granularity is 1 day and on days when there are sales of an item, I'll average the prices to get that day's average. There will be days where no sales are made, and I'm…
Caius Jard
  • 72,509
  • 5
  • 49
  • 80
6
votes
1 answer

How can I aggregate by the top N categories with an "all others" and totals?

I have tables that list a user's sales by Categories (each sale has at least one and may have several categories). I can get the top categories for a user, but I need statistics for a user by both his/her top N categories and the remainder. I've…
Brock Adams
  • 90,639
  • 22
  • 233
  • 295
6
votes
1 answer

Connect to Docker SQL Server 2017 Container on MAC OSX via SQL Operations Studio

I have the following SQL Server 2017 container up and running as per - https://learn.microsoft.com/en-us/sql/linux/quickstart-install-connect-docker CONTAINER ID IMAGE COMMAND CREATED …
WickedW
  • 2,331
  • 4
  • 24
  • 54
5
votes
0 answers

VSTS Error: SQLSQL71501: Computed Column: contains an unresolved reference to an object

I get the following error when building out my databaseB in my project. This database is referencing master, msdb as well as the other databases: databaseA and databaseAsynonyms. databaseB uses synonyms (linked server) from databaseA. The build…
Shoaib Maroof
  • 369
  • 1
  • 3
  • 13
5
votes
1 answer

Can not create Database Diagram - Could not obtain information about Windows NT Group/User

I'm using a Local MS SQL Database, the database was created automatically using entity framework. The database is created with out any errors. However when I use Microsoft Managment studio to try and create a database diagram I get the following…
Ayo Adesina
  • 2,231
  • 3
  • 37
  • 71
5
votes
1 answer

How to lock and unlock a SQL SERVER table?

At the risk of over-explaining my question, I'm going to err on the side of too much information. I am creating a bulk upload process that inserts data into two tables. The two tables look roughly as follows. TableA is a self-referencing table…
Casey Crookston
  • 13,016
  • 24
  • 107
  • 193
5
votes
2 answers

SQL to JSON - Grouping Results into JSON Array

I am trying to come up with an SQL solution for arranging output to match an expected JSON format. I have some simple SQL to highlight where the issue is coming from; SELECT TOP 1 'Surname' AS 'name.family' ,'Forename, Middle Name' AS…
Bert682
  • 87
  • 2
  • 7
5
votes
3 answers

How to change a UNION to a IN clause?

I need to get a maximum of 3 distinct records from the same table, so currently I'm doing: SELECT 1, mycolumn FROM mytable WHERE id = @firstId UNION ALL SELECT 2, mycolumn FROM mytable WHERE id = @secondId UNION ALL SELECT 3, mycolumn FROM mytable…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263