Viewing 15 posts - 3,316 through 3,330 (of 7,609 total)
Agree with Luis, except even more strongly:
We must see the DDL for the tables, including all indexes.
It would also be nice to see usage stats for those indexes,...
June 19, 2018 at 1:00 pm
Also, consider clustering dbo.MyTable on (ValidUntil, CreatedOn) or adding ValidUntil to the nonclus index. [You don't have to cluster tables by identity, and it can actually be quite harmful to...
June 19, 2018 at 12:45 pm
If you (almost) always join on all the keys, then yes, cluster on all of them.
You really should strongly consider defining the clus index before loading the table...
June 19, 2018 at 9:18 am
Given that a matched pickup and dropoff won't change in the future, when a dropoff gets entered, have a trigger link it to its pickup (store the pickup key(s) in...
June 18, 2018 at 12:00 pm
I'd check column separately rather than adding them, just in case negative amounts could appear now, or somehow do appear later:
WHERE CE.CLOSING_CREDITS <> 0 AND CE.CLOSING_DEBITS <> 0
June 15, 2018 at 4:14 pm
Also, you want to avoid BETWEEN when dealing with dates / times.
I have heard this often but I have never seen any proof as to why. I am...
June 15, 2018 at 12:55 pm
SELECT TOP (2) IDUser, Score, Name
FROM (
SELECT U.IDUser, U.Score, U.RecordDt, S2.Name,
ROW_NUMBER() OVER(PARTITION BY U.IDUser, S2.Name ORDER BY U.RecordDt DESC) AS...
June 14, 2018 at 12:20 pm
I think something like below is much easier to follow. Also, you want to avoid BETWEEN when dealing with dates / times.
I can't tell for sure if the...
June 14, 2018 at 11:53 am
Or, better yet, just go back to properly using 1NF in the table and store all values as atomic, i.e., individual columns. The computed column should be the concatenated value,...
June 12, 2018 at 1:06 pm
June 12, 2018 at 1:04 pm
1) No, afaik.
2) Yes, [H]HHHMMSS.
3) I've no longer got CDC jobs really, but I don't remember seeing that phenomenon when I did, very interesting.
June 12, 2018 at 12:59 pm
WHERE/ON SUBSTRING(string, CHARINDEX('-', string) + 1, 5) = ...
June 12, 2018 at 10:27 am
To get the avg total time, you could do this:
DATEADD(SECOND, SUM(DATEDIFF(SECOND, 0, TotalTime)) / COUNT(TotalTime), 0)
June 12, 2018 at 10:23 am
Here's a rewrite of the first query (before the UNION ALL). I don't have time to do both but they look very similar. The second two subqueries can be combined...
June 12, 2018 at 8:12 am
Viewing 15 posts - 3,316 through 3,330 (of 7,609 total)