Viewing 15 posts - 1 through 15 (of 7,418 total)
I see "emp." being referenced, but I don't see "emp" anywhere in the supplied query.
You would have to check each of the joined tables to see if there is an...
April 24, 2024 at 8:01 pm
You don't really need to partition, assuming you re-cluster, although you could. What will happen is that you will partition on date, so you will have to add date to...
April 22, 2024 at 1:26 pm
If avol is actually numeric. If it's varchar, could be an issue.
April 21, 2024 at 5:49 pm
Cluster both tables by ( StartDateTime, ID ) rather than just ID. Then, since you'll be moving data in cluster key order, you can just use a standard copy-then-delete approach.
Btw,...
April 21, 2024 at 5:47 pm
Another possibility is, assuming that:
(1) column avol was NULL before this UPDATE
(2) your server still has the default FILLFACTOR 0f 0 (=100)
Then this UPDATE could a lot of leaf page...
April 20, 2024 at 5:20 am
You *might* also want some background process to remove carts after a certain period of time, or maybe not. For example, I can go into Amazon, put something in my...
April 16, 2024 at 6:17 pm
Creating and dropping tables is significant overhead. You'd be much better of, as others have noted, with a permanent table. You could key rows in that table by user id...
April 16, 2024 at 2:42 pm
Just use a method that works under any/all DATEFIRST settings, much simpler and safer:
/* calc immediately previous Sunday; day 0 = Monday, so day 6 = Sunday...
April 15, 2024 at 1:22 pm
With 20 name columns, how do you verify that all the names are unique across all rows? And, if they're not unique, how do you know which id to assign...
April 11, 2024 at 2:33 pm
The CHECKPOINT is one of the steps required before SQL can mark the existing log space as reusable. Since you're in SIMPLE recovery model, the only thing that could prevent...
April 8, 2024 at 5:26 pm
Also, you should issue an explicit CHECKPOINT on the db when you want logs to clear. Part of the requirement for freeing log space, SIMPLE recovery, is that a CHECKPOINT...
April 8, 2024 at 1:47 pm
Scott, How do I add the tablename to this query? So it displays the tablename with the result of the max().
SET @sql_template = N'SELECT...
April 5, 2024 at 6:00 pm
I would make it truly more generic (might as well). Definitely avoid the use of INFORMATION_SCHEMA views, since they are not 100% reliable and often seem very slow. I, too,...
April 5, 2024 at 3:23 pm
SELECT ca.*
FROM dbo.history h2
CROSS APPLY (
SELECT h1.*
FROM dbo.history h1
WHERE h1.hist_id = h2.hist_id - 1
UNION ALL
SELECT h2.*
) AS...
April 2, 2024 at 4:17 pm
You're welcome! I had to make one correction to the query above, btw.
March 29, 2024 at 6:23 pm
Viewing 15 posts - 1 through 15 (of 7,418 total)