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
3 answers

SQL Server stored procedure looping through a comma delimited cell

I am trying to figure out how to go about getting the values of a comma separated string that's present in one of my cells. This is the query I current am trying to figure out in my stored procedure: SELECT uT.id, uT.permissions FROM …
StealthRT
  • 10,108
  • 40
  • 183
  • 342
1
vote
1 answer

SSAS Tabular - How to use FORMAT function in DAX summarize function

I have one Date column in my fact table, and due to some client api requirement I need to format this column as string while grouping data using SUMMARIZE function. Below is the sample query, which I am using: EVALUATE( CALCULATETABLE( …
AjayK
  • 433
  • 5
  • 18
1
vote
5 answers

SQL Server to count how many times a value appears between multiple date ranges

I have a table with two columns in question. Column A - timestamp Column B - EmpID What I'm trying to do is to compare weeks to see how many times an EmpID has repeated. For example: Week1 is my base (starting date range e.g. BETWEEN '2017-07-22'…
user8285486
1
vote
0 answers

Getting Error while creating database in SQL Server 2014

I am using SQL Server 2014 and I am trying to create a database with this command CREATE DATABASE [EFSDB] ON (NAME = N'EFSDB_Data', FILENAME = N'$MDF', SIZE = 2, FILEGROWTH = 10) LOG ON (NAME = N'EFSDB_Log', FILENAME = N'$LDF' , SIZE = 2,…
subbu
  • 3,229
  • 13
  • 49
  • 70
1
vote
1 answer

SQL query with subquery and without subquery comparison

I'd like someone who can explain me the logic difference between these two queries. Maybe you can explain performance difference also. (DB is Microsoft Northwind). -- Join select distinct c.CustomerID, c.CompanyName, c.ContactName from orders as o…
B. Carlos
  • 11
  • 2
1
vote
2 answers

Using column in CASE with COUNT without having it in group by

SELECT COUNT([P].[pkPortfolioId]) AS [OutcomeNotSubmitted], [CG].[GroupName] FROM opp.Portfolio AS [P] INNER JOIN [vendor].[CustomerGroup] AS [CG] ON [P].[fkCustomerGroupId] = [CG].[pkCustomerGroupId] WHERE fkOutcomeId IS…
Khalil
  • 1,047
  • 4
  • 17
  • 34
1
vote
3 answers

Get sql text of a UDT

When creating a function or a trigger, you can find its creation command in sys.sql_modules But what i cannot seem to find is the same for UDTs. When I create a type like this CREATE TYPE dbo.UserIds AS TABLE (value int NOT NULL PRIMARY KEY); it…
CSharpie
  • 9,195
  • 4
  • 44
  • 71
1
vote
3 answers

Select Multiple Rows from Timespan

Problem In my sql-server-2014 I store projects in a table with the columns: Startdate .. | Enddate ....| Projectname .................| Volume 2017-02-13 | 2017-04-12 | GenerateRevenue .........| 20.02 2017-04-02 | 2018-01-01 | …
LeComte
  • 13
  • 5
1
vote
0 answers

Replication and merge data back to the publisher on AlwaysOn Group SQL Server 2014

My requirement is : Prod DB is on AlwaysOn Group with SQL Servre 2014. I want to run CPU intensive jobs on replicated server and merge data back to the publisher. Replicated DB required almost real time data (1-5 mins back data is fine) to run my…
Kamal
  • 11
  • 1
1
vote
5 answers

c# time to sql date time

I am not able to convert the c# date time7/31/2017 3:13:49 PM to SQL date time while inserting the records to the database. I am doing this using DateTime dt = DateTime.Parse("11/23/2010"); string toSqlDate= dt.ToString("yyyy-MM-dd…
Virender Thakur
  • 421
  • 7
  • 23
1
vote
2 answers

c# Windows Form Application is crashed on client machine

my app is crushing on client PC . i installed another SQL server 2014 in my second laptop after changing the SQL connection string and setting file it's work for me normal . and in my developer machine " the first one" is working simple. but when i…
Nouri Yacine
  • 63
  • 13
1
vote
2 answers

Why is Sort operation before Nested Loops (Inner Join)?

I have 2 Sql Server instances, and one query: SELECT [DetailDescription], [SubTotal] FROM [dbo].[CRR] WITH (INDEX (IX_CORM_CORMId)) WHERE CORM_CORMId >= 5933168 AND CORM_CORMId <= 5955843 This leads to 2 query execution plans: Here is…
1
vote
1 answer

Merging 5 queries into 1

I have the following code which I ran (see output in image below). And what I am trying to do is to merge all the 5 mysql_cteX tables, where X = 1, 2, 3, 4, 5 together into 1 full query table. -------------------------------------- -- MERGING ALL…
fauxpas
  • 93
  • 1
  • 9
1
vote
0 answers

How implement correctly MERGE for tables? Incorrect CDC result

Once of a day one local SQL server doing synchronization with some linked server. The following query using for merge: MERGE [TargetDb].[dbo].[TargetTable] AS Target USING (SELECT * FROM [RemoteServer].[SourceDb].[dbo].[TestTable]) AS Source ON…
1
vote
2 answers

Convert Boolean To string In Datagridview?

Try Dgrd.Rows.Clear() ItDataset.Clear() Flt = "SELECT * FROM TransView WHERE TRACom = N'" & Trim$(T10ID.Text) & "'" Order By TRAID" ItDataset = GeneralDataManager.InquireData(ItDataset, Flt, "TransView") If…
Aladein
  • 184
  • 2
  • 13