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
9
votes
1 answer

Too many SQL Server users

We have a VM with a SQL Server running. Today I wanted to add a user to the box and I noticed that there are 20 SQL Server windows users. I have no idea where these came from. The description says Local user account for execution of R scripts in SQL…
Zuzlx
  • 1,246
  • 14
  • 33
9
votes
0 answers

Getting "The parameter is incorrect" when adding more than One table to DB Diagram

Using SQL SERVER 2016, Getting The parameter is incorrect exception when adding more than One table to DB Diagram. Behavior is as if there is a limit of only 1 table allowed. I've tried repairing both SQL SERVER 2016 and SSMS. After multiple…
MykeDu
  • 301
  • 1
  • 3
9
votes
5 answers

Efficient way of storing date ranges

I need to store simple data - suppose I have some products with codes as a primary key, some properties and validity ranges. So data could look like this: Products code value begin_date end_date 10905 13 2005-01-01 2016-12-31 10905 …
Roman Pekar
  • 107,110
  • 28
  • 195
  • 197
9
votes
3 answers

How can alter existence tables to SQL Temporal table by keeping data?

I have many table with data, which I want to convert to Microsoft Temporal table, But when I want to convert temporal table cause lost my data. My code is: Alter TABLE dbo.Employee ( [EmployeeID] int NOT NULL PRIMARY KEY CLUSTERED ,…
9
votes
1 answer

Incorrect syntax near 'JSON' - SQL Server 2016

So I recently installed SQL Server 2016 CTP3 mainly for the JSON output feature. I am trying to using it in my SQL Query exactly like how its shown in the link below on MSDN. The keyword JSON does not turn blue and gives error "Incorrect syntax near…
Amjad
  • 1,627
  • 5
  • 21
  • 41
8
votes
1 answer

Partition or Index large table in SQL Server

I have a large table consisting of 4 Billion+ rows and 50 columns, most of which are either datetime or numeric except a few which are varchar. Data will be inserted into the table on a weekly basis (about 20 million rows). I expect queries with…
siddharth
  • 660
  • 2
  • 6
  • 18
8
votes
2 answers

How to return multiple tables as one XML?

I have the following script: DECLARE @columns TABLE ( Caption varchar(50), Width int); INSERT INTO @columns VALUES ('Id', 0), ('Name', 100); DECLARE @rows TABLE ( Id int, [Name] varchar(50)); INSERT INTO @rows VALUES (1,…
Ivan-Mark Debono
  • 15,500
  • 29
  • 132
  • 263
8
votes
2 answers

Converting JSON to table in SQL Server 2016

I'm working on a Web project where the client application communicates with the DB via JSONs. The initial implementation took place with SQL Server 2012 (NO JSON support and hence we implemented a Stored Function that handled the parsing) and now we…
FDavidov
  • 3,505
  • 6
  • 23
  • 59
8
votes
2 answers

Database Stuck in a Single User Mode in SQL Server

Our new DBA has taken the database into a single user mode to perform the detach- attach operation but by mistake he closed the sesion. And ever since then nobody is able to access that database. I tried to find the session ID by using sp_who2 but…
user7488971
8
votes
3 answers

UPDLOCK and HOLDLOCK query not creating the expected lock

I have the below table: CREATE TABLE [dbo].[table1]( [id] [int] IDENTITY(1,1) NOT NULL, [name] [nvarchar](50) NULL, CONSTRAINT [PK_table1] PRIMARY KEY CLUSTERED ( [id] ASC )WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF,…
contactmatt
  • 18,116
  • 40
  • 128
  • 186
8
votes
3 answers

How to check if a view exists and create if it does not

I want to create a view if not exists in SQL Server 2016 IF EXISTS(SELECT 1 FROM sys.views WHERE Name = 'VI_ALL_CITIES_AS_CATEGORY') BEGIN CREATE VIEW VI_ALL_CITIES_AS_CATEGORY AS SELECT PERSONS.FIRST_NAME AS 'Име', PERSONS.LAST_NAME AS…
8
votes
1 answer

How to change SQL Server for JSON Auto column name?

In this picture, result column name(JSON_F52...) is auto-generated by SQL Server. How to change this name to unique name?
Ahmad Aghazadeh
  • 16,571
  • 12
  • 101
  • 98
8
votes
4 answers

Where clause on json data in Sql Server 2016

I have a nvarchar(1000) field in my table and I am storing JSON data in that column. eg : CONTENT_RULE_ID CONTENT_RULE 1 {"EntityType":"Inquiry", "Values":[1,2]} 2 {"EntityType":"Inquiry", "Values":[1,3]} 3 …
8
votes
1 answer

Escaping characters in T-SQL OPENJSON queries

I have the following JSON Data DECLARE @jsonData NVARCHAR(MAX) SET @jsonData = '{ "insertions":[ { "id":"58735A79-DEA8-462B-B3EB-C2797CA9D44E", "last-modified":"2017-08-08 13:07:32", "label":"HelloWorld1" …
John
  • 5,672
  • 7
  • 34
  • 52
8
votes
3 answers

SqlDataReader and SQL Server 2016 FOR JSON splits json in chunks of 2k bytes

Recently I played around with the new for json auto feature of the Azure SQL database. When I select a lot of records for example with this query: Select Wiki.WikiId , Wiki.WikiText , Wiki.Title , Wiki.CreatedOn , Tags.TagId …
VSDekar
  • 1,741
  • 2
  • 21
  • 36