Viewing 15 posts - 496 through 510 (of 3,500 total)
There's one big thing you are missing from your question - What are you trying to accomplish? Changing the EXISTS clause to a join will cause you to have duplicate...
September 14, 2021 at 12:27 am
You have data. How about posting CREATE TABLE and INSERT scripts so we can see what you're working with? While you're at it, post the expected result... but for the...
September 13, 2021 at 5:19 pm
Something like this? (I may be oversimplifying something...)
-- exclude when phone # refers to multiple people.
-- exclude when phone # refers to multiple people.
SELECT * FROM CustomerPolicies...
September 12, 2021 at 2:13 am
The easiest way is to use a Calendar table and explode the join
-- DROP TABLE #t
CREATE TABLE #t (CustNo int, Net money, StartDt datetime, EndDt datetime)
INSERT INTO...
September 11, 2021 at 2:59 pm
use TOP() or LIMIT and do the delete in batches until @@ROWCOUNT = 0?
September 10, 2021 at 3:31 pm
Post the CREATE TABLE scripts and someone can help you. =)
September 10, 2021 at 2:12 am
Great! Could you post the solution you came up with?
September 9, 2021 at 5:15 pm
I'm no expert, but you have to unravel SQL from the innermost queries to the outermost.
is there a shortcut? Not that I know of. I'd love to be proven wrong,...
September 8, 2021 at 8:13 pm
Your data is a bit wonky, but maybe something along these lines?
SELECT meshtype,
[datetime] as stamp,
tonsProduced,
theDate = CAST([datetime] AS DATE),
theTime = CAST([datetime] AS TIME)
-- fv = first_value([datetime]) OVER (PARTITION BY meshtype...
September 8, 2021 at 8:12 pm
Normalization 101 time, I think. that's a LOT of repeating fields (any time I see a column name with a number at the end, I'm immediately suspect).
Is this supposed to...
September 7, 2021 at 7:18 pm
This looks like it's supposed to be looking for the @current_proc_name value, not the literal string 'SOURCE', but then WTH do I know?
AND CHARINDEX('ALTER', @proc_source) < CHARINDEX('SOURCE',... September 7, 2021 at 6:38 am
So what do you do then? Use XE to determine which queries are run and how often to determine whether the workload improves or not with the new indexing?
September 7, 2021 at 12:13 am
Create a unique index on all the columns and make that unique?
September 6, 2021 at 11:57 pm
Multiply the result of your sum by 1.000 (adjust the number of zeroes as needed), and it will be converted to a decimal.
August 31, 2021 at 2:09 pm
use datediff and calc full days first, then subtract, then repeat for hours, and then minutes?
August 30, 2021 at 5:11 am
Viewing 15 posts - 496 through 510 (of 3,500 total)