Viewing 15 posts - 1,126 through 1,140 (of 7,608 total)
Then follow the standard method and delete from the table in batches in clus key order.
In order to do that, you might first have to go thru the table and...
November 22, 2021 at 3:36 pm
Well, if the datetime in the clus index is current datetime, you're ok. Otherwise, not good, since you wouldn't be able to easily tell when copying the "good" rows that...
November 22, 2021 at 3:23 pm
I got an email with just the initial q, I just quickly reviewed all the comments above, but my first thought was this:
;WITH ACTUALS AS
(
SELECT...
November 22, 2021 at 3:12 pm
Is the existing clustered composite key unique? And explicitly declared to SQL as unique?
November 22, 2021 at 3:02 pm
Yes, absolutely. The test server has no idea what identity values are being assigned in prod and vice versa.
November 22, 2021 at 2:58 pm
;WITH cte_dates AS (
SELECT CAST(GETDATE() AS date) AS today,
DATEPART(HOUR, GETDATE()) AS today_hour,
...
November 19, 2021 at 3:18 pm
The code below generates SQL for from 1 to 20 @Tank entries, based on which ones were actually provided in the call to the proc, and then EXECs the code. ...
November 18, 2021 at 7:11 pm
SELECT
[Shelf Location], date /*, ...*/
FROM (
SELECT *, DENSE_RANK() OVER(PARTITION BY [Shelf Location] ORDER BY date DESC) AS rank_num
...
November 17, 2021 at 7:58 pm
I see no way to accurately parse that data will all the variations presented (and any number even worse than that that could happen).
November 17, 2021 at 4:46 pm
If ID is (nearly) always an identity column, you can use ORDER BY $IDENTITY, that way you don't need to know the exact column name.
November 15, 2021 at 2:53 pm
As a bit of a sidebar, wouldn't adding more files add to the problem you spoke of previously?
I'm not sure which specific "problem" you're referring...
November 9, 2021 at 7:03 pm
It actually does explain it. If SQL has to do a sort to get the rows in the correct order, then the cursor would be required to do a sort...
November 9, 2021 at 5:38 pm
Sorry to have bothered you then. Good luck with this. (I believe if you changed your cursor to LOCAL FAST_FORWARD (as in standard in SQL Server unless you explicitly need...
November 9, 2021 at 5:31 pm
You should change the index so that it has the proper sort order already, which will (should) avoid the sort in the query:
CREATE NONCLUSTERED INDEX [IX_ImageProduct_MID] ON...
November 9, 2021 at 5:09 pm
Jeff Moden wrote:As a bit of a sidebar, wouldn't adding more files add to the problem you spoke of previously?
I'm not sure which specific "problem" you're referring to.
The one...
November 8, 2021 at 3:45 pm
Viewing 15 posts - 1,126 through 1,140 (of 7,608 total)