Questions tagged [sql-server-2016]

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

1
vote
2answers
15 views

group by JSON Column that contains an array

I have the following table:that contains these data:How can I group by my array items in my JSON Column? and get this result:
0
votes
0answers
20 views

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 ...
0
votes
1answer
79 views

T-SQL … Notation

When researching ways to optimise bulk updates to SQL Server, I have come across the following query which works correctly but I'm having difficulty understanding how the '...' notation works in the ...
-2
votes
2answers
58 views

Format the data to generate linear regression in SQL server

We are generating the following output from an SQL query for each product which is sent as an parameter+-------------+---------------+-----------------+| Quarterwise | Ship_Quantity | ...
2
votes
1answer
26 views

Supply xml element value in modify() method

So I know how to replace element value for the xml element in the modify() method. Here's the exampleTSQL Replace value in XML StringMy problem is a bit different. Taking example from above link......
0
votes
2answers
41 views

Round function query 2 to 3 arguments?

I am attempting to find the revenue per distinct user in this query but seem to be running in this error.select concat('$',format(cast(round(sum(total)/count(distinct(customers))),2) as int),N'N','...
1
vote
2answers
83 views

SQL - separate string into different columns

I am trying to separate strings into different columns which are separated by commas. I tried all the article that is on stackoverflow but not successful.Example:Column1mouse,monitor,keyboard...
0
votes
0answers
36 views

Trace flag 1802 and SQL Server 2016

I wonder if anybody out there are using trace flag 1802 in production on SQL Server 2016?I also wonder if trace flag 1802 is officially supported by Microsoft?When searching if trace flag 1802 is ...
0
votes
0answers
20 views

Expect to write String_split of SQL server into HQL

How to write HQL to have string_split to split the stringThis below query is working fine in SQL ,but want to get execute the same from HQL.Declare @test VARCHAR(50)='85583,85584,85586,85587'...
0
votes
1answer
55 views

FOR JSON in SQL Server 2016

Is there any way i can return JSON data in given below format using FOR JSON in SQL Server 2016? { "draw": 1, "recordsTotal": 57, "recordsFiltered": 57, "data": [ ...
0
votes
1answer
21 views

Split set into uneven percentage buckets

Every day I am returned a set of x rows (between 5 and 2000).I need to update a column from this set based on rules. I think this (not exactly working) example demonstrates this/* 35% a...
0
votes
2answers
32 views

How to refresh table data when in edit mode in latest versions of SQL Server Management Studio?

In SQL Server Management Studio, it is possible to open a table and see its contents, this is done by:right clicking on the tablechoosing Edit first N rows (where N is a parameter that defaults to ...
0
votes
0answers
13 views

Unable to Patch SQL Server 2016 SP2 [migrated]

Machine Details: OS: Windows Server 2012 R2Present SQL Server Version: Microsoft SQL Server 2016 (SP1) (KB3182545) - 13.0.4001.0 (X64) Oct 28 2016 18:17:30 Copyright (c) Microsoft ...
0
votes
2answers
48 views

Get filter options from SQL table having master data

I have a table with 50-60 columns having master data,something like below (just example).I need to show filters to allow the customer to filter the data. So the result would be something like below, ...
0
votes
1answer
28 views

JSON text is not properly formatted. Unexpected character 'N' is found at position 0

I am new to JSON in SQL. I am getting the error "JSON text is not properly formatted. Unexpected character 'N' is found at position 0." while executing the below -DECLARE @json1 NVARCHAR(4000)set @...
0
votes
1answer
23 views

Joining on a TVF that builds a temp table is much faster than straight clause. Why is this?

We were optimising a query that looked to be poorly designed. There was a join to a multi-line table valued function, that could easily have been an inline function, so we updated it.. but the query ...
-1
votes
0answers
34 views

SQL Server view taking too long time to execute. Please help me to optimize it [closed]

CREATE VIEW [dbo].[COMPARE_PAYMENTS_COSTS_VIEW] WITH SCHEMABINDINGAS SELECT NCLAIMID,CASE WHEN POST_JUDGMENT_PAYMENT <=POST_JUDGMENT_AMT THEN 1 ...
0
votes
0answers
30 views

Validating dynamic data masked fields

I've a situation similar like this where I want the user to stop editing the fields (textboxes) in a form which is data bind to a database column and that column is having Dynamic Data Masking (DDM) ...
1
vote
2answers
33 views

Get Dataset as Header for Another Table

I get the columns and the data of all surveys I have in the online database through my API an separately. The first example are the column headers of the first two surveysColumn TableID Col1 ...
0
votes
1answer
46 views

Long wait time of SQL Query

https://www.brentozar.com/pastetheplan/?id=HyuR18hcmIn this URL I have shared my execution plan and query which is waiting for 5940578 ms, I got this information by using Query Store, I want to know ...
0
votes
2answers
79 views

T-SQL - How to convert SELECT statements stored in table cells to a result?

I have a table that has 2 columns. The first is an ID and the second is a SQL SELECT statement related to that ID. What I need is some function or procedure that can parse every row and turn each ...
2
votes
2answers
54 views

SQL query - ntext query (for nodes, substring)

I am querying ReportServer database where SSRS metadata is stored in a field called Subscriptions.ExtensionSettings datatype NTEXT. The data values looks like XML-style text with [Name] and [Value] ...
0
votes
1answer
23 views

Parse XML using SQL

I'm using MS SQL2016 and I have an XML file that I need to parse to put various data elements into the separate fields. For the most part everything works find except I need a little help to identify ...
-1
votes
2answers
65 views

how to loop through table2 with column value in table 1

I have two tables table 1 and table 2.Table1 :ID Type StartDate EndDate UnitsAAA 1 4/3/2018 4/7/2018 1AAA 1 4/8/2018 4/21/2018 1AAA 1 1/8/2017 2/6/2017 ...
1
vote
0answers
39 views

SQL Server 2016 to oracle 18c database migration

I'm trying to migrate a database created in SQL Server 2016 to Oracle 18c. Both database instances are installed in VMs. However the migration fails providing a message which I could not ...
0
votes
0answers
12 views

Bulk insert fails when populating table from a file

I have gone through some answers but could not find the one satisfying my situation.I have a file where data is presented in the following format:11,123456789,AAAAAA,101215,0115,05,078,,3/ ...
0
votes
3answers
44 views

Select last value from Json array

I need to get the last item in an array from a JSON format. I have this JSON.@json=N'{ "solution": "xxxxxxxxxxxxxxxxxxxxx","options": [{"...
0
votes
0answers
24 views

EF how to update unique index with condition

I have a parent with multiple children. The parent children have a property of type boolean. Only one child can have the property true. I have created the EF index like so:migrationBuilder....
0
votes
1answer
32 views

JSON pairs to rows for existing json columns

With the help of @UnhandledExcepSean (Json pairs to rows) I was able to get an idea how to turn my json key/value pairs into rows. It was not as easy as I thought. However, I still have an issue. I ...
0
votes
0answers
35 views

Using UTF-8 in SQL Server 2016

We are installing a new application, the pre-requisite of which says that your database must be configured to use the UTF-8 character set.We are currently using SQL Server 2016, enterprise edition....

153050per page
angop.ao, elkhabar.com, noa.al, afghanpaper.com, bbc.com, time.com, cdc.gov, nih.gov, xnxx.com, github.com,