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

Add An Existing User SQL Server 2014

At work, I recently "inherited" a database and was told make a better one, which I have. Now I have to copy the users over, been searching, have found no easy way to this. Most of the methods involved drop the user, which I am told not to do. So,…
selpatS20
  • 63
  • 3
  • 8
1
vote
2 answers

select time in and time out for different shift

I need to find out the clock in and clock out for each employee each day. It has 2 shift, first shift is start from 0830 - 2030, second shift is from 2030 - 0830(next day). Below is the sample record I have, Time In Time Out …
Bubble Bub
  • 651
  • 4
  • 12
  • 32
1
vote
2 answers

SQL Query to get sums among multiple payments which are greater than or less than 10k

I am trying to write a query to get sums of payments from accounts for a month. I have been able to get it for the most part but I have hit a road block. My challenge is that I need a count of the amount of payments that are either < 10000 or =>…
Craig
  • 364
  • 1
  • 3
  • 25
1
vote
1 answer

Nhibernate - The same in parameter value will be applied with different name to different future queries

We are trying to eager load some data using Nhibernate future queries. As you already know while calling ToList(), all the future query that we have before will get executed in one transaction. var selectedPhysicianIds = new List {1, 2}; var…
1
vote
0 answers

db_creator role missing in SQL Server 2014 database

My apologies if this question betrays my inexperience. I am attempting to create a utility C# app to backup and restore a local database. The app uses a connection string that specifies a username and password; the user belongs to the db_owner…
1
vote
1 answer

Shred XML and show in SSRS Report

I have XML like so 1 Answer01
Abe
  • 1,879
  • 2
  • 24
  • 39
1
vote
1 answer

Compare the column values where there are null and not null values

I want to compare the values from a table where there are null and not null values for the same ID ( If not null then I want minimum of two not null values). IF all the values are null for the given ID, I want the values to be displayed as null for…
Avi
  • 1,795
  • 3
  • 16
  • 29
1
vote
0 answers

Microsoft OLE DB Provider for SQL Server: Unspecified error at System.Data.OleDb.OleDbDataReader.ProcessResults(OleDbHResult hr)

I get an exception on trying to fire a stored procedure and fill a dataset using the below method OleDbDataAdapter.Fill(Dataset ds) Please note that this exception occurs only for large tables with millions of rows, for smaller tables it works…
RaVe
  • 11
  • 1
1
vote
1 answer

Getting a weird HTTP ERROR 500 on running query on a specific database table

I have tried doing this $query = "SELECT * FROM policies"; $policies = DB::select($query); And also this $policies = Policy::all(); Whenever I try to do this, this happens here is my controller function public function…
Shateel Ahmed
  • 1,264
  • 2
  • 12
  • 23
1
vote
1 answer

Generalising an SQL table lookup function using exec

I have the following SQL function: create function [dbo].[LookUpAnonymiseString](@string varchar(500), @tableSize int) returns varchar(500) as begin DECLARE @output varchar(500) SELECT @output = Value FROM…
dahui
  • 2,128
  • 2
  • 21
  • 40
1
vote
2 answers

Performance tuning on filter data from large data set in sql server

I want to fix some performance issue with the following query. Tbl_A has 65 million rows Tbl_B has 2 rows I need to filter Tbl_A with the values of Tbl_b SELECT COUNT(*) FROM Tbl_A R1 WITH (NOLOCK) INNER JOIN Tbl_B PBD ON…
vignesh
  • 1,414
  • 5
  • 19
  • 38
1
vote
2 answers

SQL SUM logical Error

I have an issue with SUM on an SQL statement. I am using MSSQL 2014 version and Management Studio Version 12.0.2000.8. I am trying to get the Dividends for each individual from a table based on their ratio contributions and a 60% of the Total…
Simon
  • 11
  • 2
1
vote
2 answers

Why aren't sql dates getting compared?

I am comparing dates and times but it doesn't work properly sometimes Code: Select nit_no, workno, convert(datetime,convert(varchar,w.ExpiryDate,106) + ' ' + w.ExpiryTime), getdate() from works w where NIT_No= 3594 and WorkNo=1 and…
Covert
  • 480
  • 1
  • 7
  • 25
1
vote
1 answer

How can I count the rows of a table created from dynamic SQL?

I have a table containing SQL statements stored as VARCHAR. I want to count how many rows each statement returns. I'm reading the statements into a temp variable called @SQL, and doing something like this as I cursor through each row: set @SQL =…
1
vote
2 answers

Formatting with SQL DATEPART

I am using DATEPART(WEEK,mydate) to return the week number of my date, but when the week is only single number i.e. at the beginning of the year I want to format it as 01 instead of 1. I am using SQL Server 2014, I have tried using the option…
PJD
  • 743
  • 2
  • 12
  • 38