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
6
votes
2 answers

SQL Server in-memory oltp transaction snapshot isolation

Trying to understand how transaction isolation levels work on SQL Server memory optimized tables (in-memory oltp). If I execute the following query: SET TRANSACTION ISOLATION LEVEL READ COMMITTED BEGIN TRANSACTION SELECT * FROM tm.Tasks An error…
6
votes
2 answers

Get date range gaps from a date set

Here is the set we…
sqluser
  • 5,502
  • 7
  • 36
  • 50
6
votes
3 answers

SQL Server 2016 SSMS Json Formatting

I am working with JSON in SSMS in SQL Server 2016. Is there any way to get around that the results of a FOR JSON statement are presented as an XML column? Are there any settings changes, additional components, external tools, etc. or even hacks to…
WillC
  • 1,761
  • 17
  • 37
6
votes
2 answers

How can I auto increment the primary key in SQL Server 2016 merge insert without sequences?

I am writing a query to import data from one table to a new table. I need to insert records that do not exist in the new table, and update records that do exist. I am trying to use a MERGE "upsert" method. I have some unique problems due to the…
Winch
  • 117
  • 1
  • 9
6
votes
2 answers

How to find which Program or User executed Query using Query Store in SQL Server 2016+

After enabling query store, how to find who executed the query. For example, in case of trace collection, there is TRC file which will get the hostname and program details for query and in case of Extended-Events, we have XEL file which will get the…
6
votes
1 answer

Table-Valued Parameter without using a stored procedure

It seems all I can find online are examples of table-valued parameters that require using a stored procedure. I recall doing this in the past without the stored procedure. Is that possible? This code keeps throwing an error about the type not being…
Connie DeCinko CS
  • 151
  • 1
  • 2
  • 14
6
votes
2 answers

Is it possible to determine ENCRYPTBYKEY maximum returned value by the clear text type?

I am going to encrypted several fields in existing table. Basically, the following encryption technique is going to be used: CREATE MASTER KEY ENCRYPTION BY PASSWORD = 'sm_long_password@' GO CREATE CERTIFICATE CERT_01 WITH SUBJECT =…
gotqn
  • 42,737
  • 46
  • 157
  • 243
6
votes
1 answer

Date functions in temporal tables

Since SQL Server 2016 it is possible to automatically create Temporal Tables. I wanted to create a simple query that retrieves the data from a specified date. However, when I try to specify a date in the query like so, it gives a syntax error:…
iPhantomGuy
  • 240
  • 1
  • 11
6
votes
2 answers

SQL Server - recursively get into nested JSON array using cross apply or openjson or anything

I've been reading as many questions and answers as possible of the same problem but I guess my question would require more creative approach. So I have a JSON string here: declare @json nvarchar(max) = '{ "propertyObjects": [{ …
Brian Salehi
  • 414
  • 2
  • 10
  • 19
6
votes
3 answers

Delete Duplicate Rows in SQL

I have a table with unique id but duplicate row information. I can find the rows with duplicates using this query SELECT PersonAliasId, StartDateTime, GroupId, COUNT(*) as Count FROM Attendance GROUP BY PersonAliasId, StartDateTime,…
Kevin Rutledge
  • 253
  • 2
  • 3
  • 7
6
votes
1 answer

SQL Server connection timeout error in nodejs mssql

Always getting following error after couple of SQL statement execution. I am using var sql = require("mssql"); (node:12240) [DEP0064] DeprecationWarning: tls.createSecurePair() is deprecated. Please use tls.Socket instead. warning.js:18…
Furqan Misarwala
  • 1,743
  • 6
  • 26
  • 53
6
votes
3 answers

Remove query from Query Store report

I've just started using Query data store in SQL server 2016, and its very useful indeed. I have a problem in that on the server there are a number of services that are monitoring service broker queues, and as a result their WAITFOR statements…
Rob Marsh
  • 549
  • 5
  • 22
6
votes
1 answer

C# Dapper using JSON_VALUE for SQL Server 2016

I want to query data from my table using JSON_VALUE: var str = "123"; var value = "Name" using(var conn = GetMyConnection()) { var result = conn.QueryFirstOrDefault( @"SELECT [Id] FROM [dbo].[MyTable] WHERE…
Max
  • 4,439
  • 2
  • 18
  • 32
6
votes
1 answer

Why do we need Full Text index on view if the underlying table is already indexed

Let's say we have an Employees table with a full text index on a Note field. We can search that table using a query like this: SELECT ID FROM Employees WHERE CONTAINS(Note, 'scout') However, if we create an EmployeesView with something as simple…
The_Black_Smurf
  • 5,178
  • 14
  • 52
  • 78
6
votes
1 answer

Convert JSON strings to normalized schema in SQL Server

I have a table in an Azure SQL Server database which is just a single nvarchar(max) column with JSON strings in it like the one below, one per row flattened to a single line (about 200,000 rows) { "username": "George84", "items": [ …
Techrocket9
  • 2,026
  • 3
  • 22
  • 33