Viewing 15 posts - 2,146 through 2,160 (of 7,608 total)
I agree, the first method is unnecessary.
As to whether I put all on one line: if they are straightforward, I would code them in one line with ANDs. If one...
November 16, 2020 at 6:13 pm
I really hope this isn't a dumb question. Is there a reason other then style or preference as to why you'd do this:
IF @Var1 =...
November 16, 2020 at 6:10 pm
Unfortunately, we have a bit of a standard, which is that tables called "Thing" have a clustered index on ThingID, which will be an int, identity column. That's because...
November 16, 2020 at 4:58 pm
The obvious difference is the number of rows read from the T_DeliveryTimetableItemResolvedCost table, which goes from 20k to 21 million (and a seek to a scan, probably unsurprisingly). The...
November 16, 2020 at 3:42 pm
>>Use INSERT instead of MERGE in the second statement.
How would I then handle duplicates? I don't want to insert a duplicate record if there already is one that matches...
November 16, 2020 at 3:35 pm
Since you only want monthly totals, I don't see any reason for the overhead to create a row for every single day; instead, you really only need a row for...
November 16, 2020 at 3:24 pm
The SERIALIZABLE would cause higher levels of locks and cause them to be held longer.
Use INSERT instead of MERGE in the second statement.
Personally I'd use an UPDATE then INSERT on...
November 16, 2020 at 2:44 pm
I guess the sequence must be called so many times that you're running out of values for an int.
Maybe use a bigint for the sequence?
November 16, 2020 at 2:40 pm
I can't test these since you didn't provide directly usable test data:
--if you need only the acct_ids
SELECT acct_id, COUNT(*) OVER() AS total_accts
FROM my_table
GROUP BY acct_id
HAVING MIN(street +...
November 13, 2020 at 2:32 pm
As noted by Brian, your table design is completely wrong. You've then had to corrupt the data to fit it into the bad table structure.
For example, the language is "English". ...
November 13, 2020 at 2:11 am
I think there is one way you can try the upgrade path.
IF your san/disk/software allows you to snapshot a given point-in-time on disk, and accurately restore everything on disk (including...
November 12, 2020 at 2:27 pm
OP = "original poster", i.e., the person that originally asked the q (or, rarely used and only by some people, "original post")
November 11, 2020 at 8:52 pm
The actual database and logfiles should preferably be kept on same drives as they are now.
The most simple approach I can come up with is:
November 11, 2020 at 4:16 pm
I think you're correct, you should do this for all tables. No sense wasting resources scanning a 900-row table either. Of course that 900 rows could be far...
November 11, 2020 at 12:13 am
I think you're correct, you should do this for all tables. No sense wasting resources scanning a 900-row table either. Of course that 900 rows could be far larger than...
November 10, 2020 at 8:35 pm
Viewing 15 posts - 2,146 through 2,160 (of 7,608 total)