Viewing 15 posts - 946 through 960 (of 3,500 total)
There's a new cardinality estimator in SQL 2016. Force your query to use the old one. See: https://stackoverflow.com/questions/47215135/facing-performance-issues-in-sql-server-2016-after-migration
July 11, 2019 at 1:24 pm
Sounds like a job for CROSS APPLY.
SELECT e.EquipmentName
, lw.WarrDescription
, lw.StartDate
, lw.EndDate
FROM Equipment e
CROSS APPLY (SELECT TOP 1 StartDate, EndDate, WarrDescription
FROM Warranty...
July 9, 2019 at 4:32 pm
Multiple UNIONs? That's a recipe for a long long wait. Can you post the query?
You can try using UNION ALL between the individual queries instead of UNION. UNION will remove...
July 3, 2019 at 2:23 pm
got CREATE TABLE and INSERT scripts?
That post is nonsensical without them
July 2, 2019 at 6:11 pm
I did the Prerequisite/Co-requisite course thing a long time ago, and asked about it there. So if you look for it, Jeff Moden and someone else answered and came up...
June 29, 2019 at 7:49 pm
I formatted it.. I got lost in the CTE stuff because I wasn't following all the logic. I would definitely comment the chunks just to make it easier for other...
June 29, 2019 at 7:32 pm
In the absence of better code, this is what I came up with. I'm assuming you have a table of holidays like #Holidays table. Then you just check for the...
June 28, 2019 at 3:17 am
Shouldn't your WHERE clause be like this?
WHERE SoftwareTitle NOT IN ( SELECT <fieldname> FROM #TempTable)
You can't match a single column (SoftwareTitle) to all the columns (*) in #TempTable
June 16, 2019 at 12:59 am
Something like this?
SELECT *
FROM CustInfo ci
WHERE DateCreated IN ( SELECT DateCreated
FROM CustInfo
WHERE EntryType = 'Expired')
AND ci.EntryType != 'Expired';
(Sorry, I renamed your table to CustInfo).
June 12, 2019 at 6:45 pm
Without CREATE TABLE and INSERT scripts (sample data), there's no way to answer your question.
What does "didn't work" mean?
June 11, 2019 at 5:59 pm
I think having a slide so attendees can decide whether the presentation will benefit them is a good idea. I think it would be a good idea to include that...
June 10, 2019 at 11:24 pm
Maybe this will help (?)
use tempdb;
go
declare @SomeDate DATE = '2019-05-31';
SELECT @SomeDate AS TextDate,
DATEADD(day,1,CAST(@SomeDate AS DATE)) AS NextDay,
YEAR(CAST(@SomeDate AS DATE)) AS SomeYear,
CONCAT(CONCAT(DATENAME(month,CAST(@SomeDate AS DATE)),' '), YEAR(CAST(@SomeDate AS DATE)))...
June 6, 2019 at 4:10 am
Set up cascading deletes between the parent and child tables, and just delete from the parent table?
Or use a trigger to get the IDs from the deleted virtual table and...
May 30, 2019 at 7:09 pm
Second Step:- Then I want to compare each B_time if It is 30m different then Sum(b_rate) and total count.?
30m different from what? the previous record? Use LAG() for that. Then...
May 30, 2019 at 2:36 am
You need Jeff Moden's DelimitedSplit8K function to do that.
Here's how to use it... (but do read the article - it's really good!)
CREATE TABLE SomeData(emailaddr VARCHAR(20), Repeating...
May 29, 2019 at 11:32 pm
Viewing 15 posts - 946 through 960 (of 3,500 total)