Viewing 15 posts - 2,146 through 2,160 (of 7,614 total)
You could run the job every minute. But I'd say run the job every 10 minutes (or, I guess, 5 minutes). Would it really be that big a deal to...
November 18, 2020 at 4:43 pm
We have job which is configured to recycle the sql error log on daily basis
Are you using the standard sp_cycle_agent_errorlog proc or did you try something home grown? ...
November 17, 2020 at 5:07 pm
It's not worth that risk for such a tiny gain.
In a single execution, the gain may be small, bring it up to 100K/Sec and that difference can...
November 17, 2020 at 5:03 pm
Just a quick thought: Any IF statement will add an evaluation step to the execution Any AND will do the same Conditionals (IFs) introduce branching, even if there is...
November 17, 2020 at 3:27 pm
I used a table for the location_id(s) to be combined, so that it would be easy to do multiple combinings. For example, if you uncomment the (1, 30), you'll see...
November 17, 2020 at 3:21 pm
In this specific case, I'd recommend you add a couple of triggers to the table to maintain an accurate flag for this in the parent row.
You'd need an INSERT trigger...
November 16, 2020 at 8:50 pm
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
Viewing 15 posts - 2,146 through 2,160 (of 7,614 total)