Do you have out of date index statistics?
As you may all know, having up to date index statistics is the key to make sure the query optimizer can choose the most optimal execution plan for any...
2019-05-01
177 reads
As you may all know, having up to date index statistics is the key to make sure the query optimizer can choose the most optimal execution plan for any...
2019-05-01
177 reads
For me, this particular code to generate a script to recreate indexes has more practical use in a replication environment.
For example, the default replication setting is to exclude the...
2019-04-25
468 reads
select
s.session_id,
db_name(s.database_id) DB,
s.login_time,
s.host_name,
s.program_name,
s.login_name,
s.cpu_time,
s.memory_usage,
s.total_scheduled_time,
s.total_elapsed_time,
s.endpoint_id,
s.last_request_start_time,
s.last_request_end_time,
s.reads,
s.writes,
s.logical_reads,
s.is_user_process,
s.row_count,
s.open_transaction_count,
t.text as [command]
from sys.dm_exec_sessions s
inner join sys.dm_exec_connections c...
2019-04-25
57 reads
Suppose you want to or need to know anytime your SQL Server is experiencing blocking where queries are being blocked and it may or may not escalate to a...
2019-04-30 (first published: 2019-04-17)
1,709 reads
# Assuming you have list of servers in servers.txt, each server name in its own line
$ComputerNames = get-content servers.txt
# Method 1 - Using the Get-Counter cmdlet#...
2018-10-08
1,033 reads
# Assuming you have list of servers in servers.txt, each sever name in its own line
$ComputerNames=get-content servers.txt
Get-WmiObject -Query "select * from win32_service where...
2018-10-08
212 reads
Do you think you need to use commercial tools like SQL Diagnostic Manager, SQL Sentry, Spotlight etc.. ? Or do you think...
2018-10-07
471 reads
Here is a DMV script to check whether a or any database has the auditing configured and running, along with...
2018-09-18
754 reads
Do you ever wonder if there are any databases in your environment that may just be there but not being...
2018-09-18
181 reads
I was entrusted with a new database for a critical application that was having general performance issue and the CPU...
2018-05-10
1,568 reads
Disclaimer: The following is built with Claude Code. Just need to justify my $100/mo...
By Brian Kelley
I developed these rules a while back, before COVID. I had a period of...
By Steve Jones
Someone asked why I would use TRY_PARSE after I posted a question at SQL...
I have a table that ends in ON [PRIMARY] TEXTIMAGE_ON [PRIMARY]. I'm about to...
Comments posted to this topic are about the item OUTER APPLY Fundamentals: Part 2
Comments posted to this topic are about the item Building Great Software
I have this data in the OrderHeader table in a SQL Server 2025 database (ordered by CustomerID ASC):
orderid orderdate customerid complete 3 2025-05-10 00:00:00.0002 1 21 2024-01-10 00:00:00.0003 1 15 2023-10-28 00:00:00.0004 1 13 2025-03-08 00:00:00.0006 1 11 2024-04-02 00:00:00.0007 1If I run this query, how many rows are returned?
SELECT * from dbo.OrderHeader where customerid between 3 and '6'See possible answers