Questions tagged [sql-server-2014]

Use this tag for questions specific to the 2014 version of Microsoft's SQL Server database engine. SQL Server 2014 is the predecessor of the later SQL Server 2016.

SQL Server 2014 (codename Hekaton, version 12.00), released in April 2014, is the successor to SQL Server 2012 and the predecessor of the newer version of Microsoft's SQL Server database engine SQLServer 2016.

This tag covers questions specific to the 2014 version of the database engine. It is recommended that the tag is also used when tagging questions with this version specific tag.

Read more about SQL Server 2014 from MSDN.
Get SQL Server 2014 from here.

4735 questions
7
votes
2 answers

Unable to pass empty string into non-null database field

I'm stumped on something which should be very straight-forward. I have a SQL Server database, and I'm trying to update a non-nullable varchar or nvarchar field with an empty string. I know it's possible, because an empty string '' is not the same…
Jerry Dodge
  • 26,858
  • 31
  • 155
  • 327
7
votes
2 answers

Checking variable for NULL kills performance

I have following queries: DECLARE @application_number CHAR(8)= '37832904'; SELECT la.LEASE_NUMBER AS lease_number, la.[LEASE_APPLICATION] AS application_number, tnu.[FOLLOWUP_CODE] AS note_type_code -- catch codes not in codes table FROM…
7
votes
3 answers

Rank records based on 1 column's changing value

Q: How can I rank records based on 1 column's changing value? I have the following data (https://pastebin.com/vdTb1JRT): EmployeeID Date Onleave ABH12345 2016-01-01 0 ABH12345 2016-01-02 0 ABH12345 2016-01-03 0 ABH12345 …
Emil Vissing
  • 460
  • 4
  • 19
7
votes
1 answer

DAX FILTER function with multiple criteria

I have a DAX statement and I run it inside SSMS. my original statement is: evaluate(filter('rptLoan', [RemainingDays] <= 10)) and it works file. I want to add another criteria as below evaluate(filter('rptLoan', [RemainingDays] <= 10 and [CloseDt]…
user7577311
7
votes
3 answers

Preventing deadlocks in SQL Server

I have an application connected to a SQL Server 2014 database that combines several rows into one. There are no other connections to this database while the application is running. First, select a chunk of rows within a specific time span. This…
Jussi Kosunen
  • 8,277
  • 3
  • 26
  • 34
7
votes
2 answers

Can I get "BULK INSERT"-like speeds when inserting from Java into SQL Server?

During my quest to find the fastest method to get data from Java to SQL Server, I have noticed that the fastest Java-method I can come up with, is still 12 times slower than using BULK INSERT. My data is being generated from within Java, and BULK…
Wouter
  • 1,829
  • 3
  • 28
  • 34
7
votes
1 answer

Response data truncation when running SP through job

Subject: I've got a report that I create every month. The creation of report consists of 2 steps: Get an XML from our service and store it in DB; Parse XML and create file. For the last few month I've created report in manual mode. And now I want…
gofr1
  • 15,741
  • 11
  • 42
  • 52
7
votes
2 answers

Odd SQL Server (TSQL) query results with NEWID() in the "WHERE" clause

This is an odd question to be sure, but I'm a bit flummoxed for an explanation for this behavior: Background: (not required to know) So to start, I was writing a quick query and was pasting a list of UNIQUERIDENTIFIER and wanted them to be uniform…
ckozl
  • 6,751
  • 3
  • 33
  • 50
7
votes
0 answers

How do I turn off background processing with SQL server data tools in VS2013

I am using Visual studio 2013 with the SQL data tools (SSDT) with SQL project. When I open the project then every time it will checking some background models and showing the message like this "Verifying your model is synchronized with your source…
7
votes
2 answers

What's this column [Bmk1002] in the table scan operator of my execution plan?

I have a simple script. IF OBJECT_ID('dbo.Customers', 'U') IS NOT NULL DROP TABLE dbo.Customers; GO CREATE TABLE dbo.Customers ( custid INT NOT NULL, companyname VARCHAR(125) NOT NULL, phone VARCHAR(120) NOT NULL, address VARCHAR(150) NOT…
Just a learner
  • 26,690
  • 50
  • 155
  • 234
7
votes
4 answers

Is it possible to restrict a sql table to only have a single row at the design stage

I have a simple table as scripted below. CREATE TABLE dbo.KeyNumbers ( RowId INT IDENTITY ,ProFormaNumber NCHAR(10) NULL ,SalesOrderNumber NCHAR(10) NULL ,PurchaseOrderNumber NCHAR(10) NULL ,InvoiceCreditNoteNumber NCHAR(10) NULL …
Dom Sinclair
  • 2,458
  • 1
  • 30
  • 47
7
votes
1 answer

How to link servers in different AD-Domains?

I am trying to link two SQL Servers (2008R2 and 2014) which are running in two separate (!) Active Directory domains. The problem is that I can login into the remote server only with a Windows Account from the remote domain. So the challenge is to…
7
votes
4 answers

HAVING clause: at least one of the ungrouped values is X

Example table: Col1 | Col2 A | Apple A | Banana B | Apple C | Banana Output: A I want to get all values of Col1 which have more than one entry and at least one with Banana. I tried to use GROUP BY: SELECT Col1 FROM Table GROUP BY…
D.R.
  • 20,268
  • 21
  • 102
  • 205
7
votes
4 answers

Comparing two variables in SQL

Lets say you have the next code: DECLARE @A INT = 1, @B INT = NULL; IF (@B != @A) SELECT 1; ELSE IF (@B = @A) SELECT 2; ELSE SELECT 3; As you can see variable @A equals '1' for sure and variable @B certainly doesn't. I'm…
msmolcic
  • 6,407
  • 8
  • 32
  • 56
7
votes
3 answers

Does Azure SQL Database support In Memory Optimized Tables?

I'm trying to look at the SQL Server 2014 and In Memory Optimized Tables and it integration with Power BI. And I'm thinking about what is the best way to migrate existing database (contains several In Memory Optimized tables) to Azure? Does Azure…