Viewing 15 posts - 2,566 through 2,580 (of 59,086 total)
Generate your dates and then play the following function against those dates using "3" as an @DateFirst parameter. Post back if needed.
The dates don't need to be contiguous. You could...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2022 at 6:12 pm
The flow chart at the following MS link identifies where to find all the steps based on your configuration.
The main article that came from is at the following.
You just need...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2022 at 6:06 pm
But this returns the total number of read and writes from the start.
So use LAG to find the difference between the current reading and the previous reading to find...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2022 at 5:50 pm
sys.dm_io_virtual_file_stats returns data since last startup of SQLServer.
To get what you aim for, you should persist its data yourself.
By itself that data means nothing at all.
It's only use...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2022 at 5:48 pm
It could also be that that data isn't being deleted in the same order as the Clustered Index. If that's true, you can recover the space left by the deletes...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2022 at 5:24 pm
Something like this using a tally table or function:
DECLARE @startDate date = '2021-01-06'
DECLARE @nextYear date = DATEADD(year,1,DATEADD(year,DATEDIFF(year,0,@startDate),0));
SELECT DATEADD(WEEK,Number,@startDate ) AS StartDate, DATEADD(DAY,6,DATEADD(WEEK,Number,@startDate )) AS EndDate,...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 27, 2022 at 5:15 pm
+1 Million!
--Jeff Moden
Change is inevitable... Change for the better is not.
October 26, 2022 at 7:13 pm
Hello, I want to be able to view the number of read and writes for a database or (tables in the database) in a day or week or month....
--Jeff Moden
Change is inevitable... Change for the better is not.
October 26, 2022 at 7:05 pm
Often a project has multiple customers and multiple perspectives. A developer trying to satisfy an external customer, might prioritize that party over an internal customers like a DBA. Time...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 26, 2022 at 7:00 pm
Excellent article, ...
I absolutely love it when the challenge at hand requires a graceful and carefully engineered solution, but I also find it gratify to simply craft something...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2022 at 6:58 pm
So test the values of @startdate and @enddate to make sure that they're both >= DATEADD(yy,-1,CONVERT(DATE,GETDATE())) and pop the message if they're not.
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2022 at 2:28 pm
Getting back to the original post... you do know what sys.dm_db_index_physical_stats() is for, correct?
Ok... After a year, I'll take that as a "No". 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2022 at 2:16 pm
From what I read, and think I understood, this code is creating a watchdog that looks for SQL statements that contain the "Having" clause. When it sees that clause,...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2022 at 1:59 pm
Jeff Moden wrote:Reminder... STRING_AGG() wasn't available until 2017. The OP posted in a 2016 forum.
Thanks, Jeff, I should have checked that!
Not to worry... I've been bitten by that type of...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2022 at 1:54 pm
also i working on sql server 2019
so are using CHECKSUM_AGG will working
or not working good
I don't understand what you're saying here. Is the STRING_AGG() solution working for you but...
--Jeff Moden
Change is inevitable... Change for the better is not.
October 25, 2022 at 1:46 pm
Viewing 15 posts - 2,566 through 2,580 (of 59,086 total)