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
1
vote
1 answer

SQL Server : merge replication error

Can anyone please help me out to solve this error in SQL Server merge replication? The merge process could not replicate one or more INSERT statements to the 'Subscriber'. A stored procedure failed to execute. Troubleshoot by using SQL Profiler.…
1
vote
1 answer

SQL Server: Multi-Row Insert with different types

I have a strange behavior when inserting multiple rows in a table with mixed types in the values. The SQL for creating the table is: CREATE TABLE [dbo].[insert_test] ( [col1] [nchar](10) NULL ) ON [PRIMARY] When inserting multiple values (with…
1
vote
1 answer

T-SQL - Based On A specific value Remove the Row

In my case I need to filter a file based on a ITSUser and its role. The user can have 2 roles "A" and "B".I want only 1 File per 1 Row based on below conditions. If StateFile has ITSUser exists in the file and has NO role "B" then --> Yes , No Else…
Learning_Learning
  • 317
  • 1
  • 5
  • 18
1
vote
2 answers

Move Columns to next if null

I want to move color forward to next column if the required columns are null however I used COALESCE function but I am unable to get expected result Below is my table structure ID. Level1. Level2. Level3 Level5 1. Xyz. …
1
vote
1 answer

Pattern matching on joins

Say I have two tables, one called InternalCustomers which contains all my customers, and a table called ExternalCustomers which contains customer information from an external source. In my table I have a Legal_Id for the customer which is an…
ssn
  • 509
  • 3
  • 12
1
vote
2 answers

SQL to SUM certain rows only

I'm trying to find a method to sum a dollar amount in a small data set, but only on certain rows. This data is extracted from another system that I cannot change. This will be used for one-time data import into SQL so pretty and efficient are low…
Area51Resident
  • 71
  • 1
  • 2
  • 8
1
vote
2 answers

Select "case when"... yields grouped results... how to obtain aggregate data?

Newer SQL user working with SQL Server 2014 SP2. I'm trying to determine how to improve my results on a particular query. The problem is that when I select data with a Case When, it requires me to use group by to aggregate the data. I am trying to…
1
vote
3 answers

How to display output like this in SQL?

I have a table like the one shown below: +----------------+-------+----------+---------+ | Name | Model | system | ItemTag | +----------------+-------+----------+---------+ | Alarm Id | T58 | ASC | …
aryan
  • 49
  • 6
1
vote
1 answer

This server version is not supported. Only servers up to Microsoft SQL Server 2005 are supported

For some days I am a little desperate about a problem in Visual Studio 2008, what happens is that in my company I work with VS 2008 and SQL Server 2014, I have worked normally but when choosing a new connection in a DataSet (Example: when I want to…
Julián
  • 1,238
  • 1
  • 12
  • 24
1
vote
3 answers

Stored Procedure statement terminated Error?

I am using below stored procedure to insert records from another view: ALTER PROCEDURE [dbo].[SPemployeeinsert] (@date DATETIME) AS BEGIN DECLARE @idinsert AS INT SELECT @idinsert = MAX (ID) + 1 FROM dbo.EMP INSERT INTO…
aryan
  • 49
  • 6
1
vote
1 answer

Create SQL Server grant user

I created a database in SQL Server 2014 and entered with sa, is the administrator. How do I make the sa only have permission to see procedures? And how to create another admin user, using code? I tried this CREATE LOGIN ztestecom WITH PASSWORD =…
1
vote
1 answer

SQL Server to count how many times a value appears between multiple date ranges and compare to previous weeks

I first asked a similar question at SQL Server to count how many times a value appears between multiple date ranges and wasn't sure if I should post a new question or modify the original post. Though it's building on the original post I felt it…
user8285486
1
vote
4 answers

SQLServer Order By IGNORE NULL values

For some reason I can't change the table or update the data for now. Here the problem : I have menu_user table below : userID menuID (null) 2 (null) 3 1 3 2 1 3 2 4 5 5 0 userID and menuID not duplicated. The…
Jun Rikson
  • 1,964
  • 1
  • 22
  • 43
1
vote
2 answers

Insert only up to a maximum number?

I have an existing stored procedure that returns shopping cart items as individual rows, with one of the fields being Quantity of the said item. In the case of a promotional offer, for example buy 2 and get another 2 free, then the same product will…
Wompguinea
  • 378
  • 3
  • 19
1
vote
3 answers

Two comma seperated cell merge with final output

Hey all I have the following SQL Query that I am using in order to get comma separated values from a cell: WITH cte AS( SELECT uT.id AS UID, uT.employeeID, uP.type, pP.name FROM usersTbl…
StealthRT
  • 10,108
  • 40
  • 183
  • 342