Questions tagged [sql-server-2016]

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

Microsoft SQL Server 2016 v.13.0.1601.5 Ready To Manufacture (RTM), was released on June 1, 2016.

There are many editions of SQL Server 2016:

1- Entreprise Edition : Comprehensive, mission-critical in-memory performance with unparalleled security, mission critical high availability, an end-to-end enterprise business intelligence solution with mobile BI built in, in-database advanced analytics at scale, and unlimited virtualization with software assurance. Enterprise edition provides the highest scale and performance for Tier-1 workloads.

2- Standard: Find rich programming capabilities, security innovations, and fast performance for applications and data marts. Easily upgra

3- Developer: Build, test, and demonstrate applications in a non-production environment with this free, full-featured set of SQL Server 2016 SP1 Enterprise edition software.

4- Express: Deploy small databases in production environments with this free, entry-level database that’s ideal for building small, data-driven applications up to 10 GB of disk size.

5- Compact: Free, embedded database app for building ASP.NET websites and Windows desktop applications.

6- Web: Secured, cost effective, and highly scalable data platform for public web sites—available to third-party hosting service providers only.

References

3794 questions
7
votes
1 answer

SQL Server - "for json path" statement does not return more than 2984 lines of JSON string

I'm trying to generate huge amount of data in a complex and nested JSON string using "for json path" statement, and I'm using multiple functions to create different parts of this JSON string, as follow: declare @queue nvarchar(max) select @queue =…
Brian Salehi
  • 414
  • 2
  • 10
  • 19
7
votes
8 answers

Empty string results in "Errors were detected in the command line arguments, please make sure all arguments are set correctly"

On a SQL 2016 Server I have a job that calls an SSIS package. That package is in a project in the SSISDB and has parameters. One of those parameters is a string type that is blank as a default. I ran the job with the blank value for this…
Tab Alleman
  • 31,483
  • 7
  • 36
  • 52
7
votes
2 answers

How to read a property with a long value from JSON string?

I have a JSON object where one of the properties has a very long value. When I try to extract this value using JSON_VALUE(), it returns null. declare @json nvarchar(max) = ' { "AVeryLongValue": "Founded in 2008, Stack Overflow is the largest,…
HappyTown
  • 6,036
  • 8
  • 38
  • 51
7
votes
1 answer

Why does the FOR Clause not work with an alias in SQL Server 2016 with temporal tables?

I have a SQL Server 2016 database with temporal tables. One temporal table is called Company. I am trying to query it to get current records and all historical records. I first tried the following query: select * from Company c FOR SYSTEM_TIME…
jsakowitz
  • 71
  • 3
7
votes
1 answer

Using MSSQL 2016 "AT TIMEZONE" feature from Entity Framework?

How would one use the MSSQL 2016 AT TIMEZONE feature from Entity Framework? In other words, how to generate SELECT MyTimestamp AT TIME ZONE 'Central European Standard Time' FROM MyTable by LINQ in entity framework ? Is it even supported yet ? Can…
Anders
  • 93
  • 5
7
votes
1 answer

The data types date and datetime are incompatible in the add operator

I recently created in a SQL Server 2008 dev environment a function that concatenates a date and time like this select cast('2016-11-09 15:35:00' AS DATE) + CAST('00:00:00' AS DATETIME) In SQL Server 2008 it works well but deployed in SQL Server…
Maximus Decimus
  • 4,901
  • 22
  • 67
  • 95
7
votes
2 answers

The best mechanism for alter columns of system versioning tables (Temporal Table)?

I have a system-versioning table with history table related as follows: CREATE TABLE [dbo].[ExpenseCenter_Archive]( [ExpenseCenterId] [tinyint] NOT NULL, [Name] [nvarchar](200) NOT NULL, [LineCode] [smallint] NOT NULL, [SysStartTime]…
Aiyoub A.
  • 5,261
  • 8
  • 25
  • 38
7
votes
2 answers

How to Keep Modifier ID in System Versioned Temporal Tables?

I have a system-versioned table in sql server 2016. I want to store Modifier ID in its temporal (history) table while users are performing delete or update action on the table. Is there any built-in solution by sql server 2016 to do that?
Nima Rostami
  • 2,652
  • 3
  • 15
  • 23
7
votes
2 answers

SQL 2016 Live Query Statistics Error: "An error occurred while executing batch. Error message is: One or more errors occurred."

I am testing out SQL 2016 Live Query Stats in SSMS and every time I try it I get the error "An error occurred while executing batch. Error message is: One or more errors occurred." and no result set is returned. A co worker has tried it and it…
tbdevmanager
  • 373
  • 5
  • 15
6
votes
4 answers

Join tables but allow use of records once only

CREATE TABLE #A (UpperLimit NUMERIC(4)) CREATE TABLE #B (Id NUMERIC(4), Amount NUMERIC(4)) INSERT INTO #A VALUES (1000), (2000), (3000) INSERT INTO #B VALUES (1, 3100), (2, 1900), (3, 1800), (4, 1700), (5, 900), …
Smudge202
  • 4,689
  • 2
  • 26
  • 44
6
votes
1 answer

Complex recursive SQL to produce hierarchical data

I am trying to evaluate the impact of store visitors on the spread of COVID-19. Here is a simple scenario: VisitorA walks into store and meets Employee1 @ Time = 0. VisitorA then meets Employee2 @ Time = 1. VisitorB walks into store and meets…
nael
  • 1,441
  • 19
  • 36
6
votes
1 answer

SQL Server 2016 : join DATETIME2(3) with DATETIME

I'm getting unexpected results when joining on a DATETIME2(3) and a DATETIME column with PK, in SQL Server 2016. I have the following table: CREATE TABLE DATETIME_TEST ( [DATETIME] DATETIME NOT NULL, [DATETIME2_3] DATETIME2(3) ); ALTER…
Ida Amit
  • 1,411
  • 2
  • 13
  • 27
6
votes
6 answers

How to use CASE statement inside a WHERE with an IN clause?

I am trying to do the following (pseudocode since it doesn't compile): declare showListedOrSold int = 1 -- get value from config table select * from table where CASE WHEN @showListedOrSold = 0 THEN id IN (1, 2, 5, 6, 10, 11) WHEN…
AngryHacker
  • 59,598
  • 102
  • 325
  • 594
6
votes
3 answers

SQL Replace All Tables with Clustered Columnstore Index

We are conducting a migration project, and looking to replace most Rowstore indexes with Clustered Columnstore indexes for large Data Warehouse. We are adding a unique index on the identity column. Does anyone have script to alter run through all…
user11156893
6
votes
1 answer

Deploy SSIS Project using TFS Command Line

How do I deploy an SSIS project from TFS 2015? For regular database projects, it is sqlpackage.exe /publish with publish profile. What is the command line argument to auto deploy SSIS Project Model into a server? We are using SQL Server 2016…
user11156893