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

Object approach to database which has variable scheme

I am developing a C# app where I have to read/write existing MS SQL database. I decided to use object class for the database but the table columns can be changed during runtime and that causes an exception because of an attempt to write a new row…
1
vote
2 answers

Insert variables into a SQL Server table in stored procedure

I am trying to insert variables into SQL Server table dynamically inside a stored procedure but I'm not able to accomplish it because of the syntax. Can someone correct me what am I doing wrong in the below code. Thanks. Code I have tried: SET…
1
vote
1 answer

SQL Server Stored Procedure Conversion failed when converting date and/or time from character string

I know that this question has been asked a few times, but the suggestions don't seem to be working for me. I have an 83 line stored procedure that I need to call and pass a start and an end date into it. The procedure works great if I hard code…
1
vote
1 answer

Check values in all previous rows in SQL table

I have the following SQL table: declare @t table(START_DATE datetime,INDEX_ID int, GROSS_SALES_PRICE decimal(10,2)); insert into @t values …
1
vote
1 answer

CREATE A QUERY WITH GROUP BY

I am trying to count how many "subsidiary companies" work for each "parent company", I came up with something like this... select cs.contract_number, jd.Job_description, c.Parent_Company, count(sub.subsidiary_company) from contracts cs …
caa35
  • 71
  • 2
  • 10
1
vote
1 answer

I am not able to create report server project in my visual studio 2012

I have visual studio 2012 and SQL Server 2014 installed in my machine. As a part of my work I require to open and RDL (SSRS) file in design view. When I checked in the google I saw that I need to have SQL Server Report Services in my visual studio…
Rinoy Ashokan
  • 1,501
  • 17
  • 14
1
vote
1 answer
1
vote
1 answer

get first value of a field based on the max of another field while other max fields are also being used

I'm using multiple MAX statements to get the "last activity" for students. Students have an enrollment record for each year they enroll. I get all the correct results with the exception of one field..the school name of the last school the student…
Bill G
  • 19
  • 2
1
vote
0 answers

SQL2008 to SQL2014 authentication issues

We recently migrated an application database to a new version from winserv2008/sql2008 to winserv2012R2/Sql2014. A service that pulls on this DB needs to be redesigned to accommodate some minor table/view definition changes. Running the service…
1
vote
1 answer

MS SQL SERVER 2014: Get Number of Days Between Occurrences

I have a table with the following structure (Occurrence Table): ID EmployeeID DateOfOccurrence -------------------------------------- 1 999999 2017-02-14 2 999999 2017-03-02 3 999999 2017-03-23 4 …
klbass68
  • 33
  • 1
  • 8
1
vote
1 answer

Convert columns to rows based on condition in SQL Server

Below is the table design CustId Ver VersionNo Version ResNO Res Name Path --------------------------------------------------------------------------- 2 VF 2 V2 1 Low temp a/PV_7_temp.pdf 2 …
Ajt
  • 1,719
  • 1
  • 20
  • 42
1
vote
1 answer

dropping an index speeds up query: why?

By trial and error, i found that an index on a table on my DB was drastically affecting the performance of a query. With index: execution time 30sec Without index: execution time <1sec It is the first time I see something similar, anyway the index…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
1
vote
1 answer

Cannot create a foreign key becaue it is in conflict with itself

I am trying to add a Foreignkey to a table and i cannot because i get this error: Msg 547, Level 16, State 0, Line 1 The ALTER TABLE statement conflicted with the FOREIGN KEY constraint "FK_RDATA_COMBO_VALUES_ID_REFERENCES". The conflict…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
1
vote
2 answers

ORDER BY the Items Within a Case Statement

Is there another way I can sort the results by the Age Group appropriately? As a work-around, I placed a character before each age group to display in chronological order - but if the letter is not there, then it does not display in the order I am…
MISNole
  • 992
  • 1
  • 22
  • 48
1
vote
2 answers

Replace index scan on index seek in SQL Server SELECT query

The first query works fine with index seek (https://www.brentozar.com/pastetheplan/?id=B1XMM_YeW): SELECT * FROM dbo.MessageLast c WHERE c.Stat_Date >= '2017-04-25' AND c.Stat_Date <= '2017-04- 26' AND…
1 2 3
99
100