Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Index Scan/Seek/Lookup/Update Breakdown | |
SELECT | |
DB_NAME([ddius].[database_id]) AS [database name], | |
s.[name] AS 'Schema_Name', | |
OBJECT_NAME([ddius].[object_id]) AS [Table name], | |
CASE | |
WHEN ddius.index_id=1 THEN '*'+[i].[name]+'*' | |
ELSE [i].[name] | |
END AS [index name], |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- Simple | |
SELECT | |
@@SERVERNAME AS 'Server', | |
DB_NAME(dbid) as 'Database', | |
COUNT(dbid) as 'Number Of Open Connections' | |
FROM | |
sys.sysprocesses | |
WHERE | |
dbid > 0 | |
GROUP BY |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- Blocked Process Report | |
IF | |
( | |
SELECT value_in_use | |
FROM sys.configurations | |
WHERE name = N'show advanced options' | |
) <> 1 | |
BEGIN | |
EXEC ('EXEC sp_configure ''show advanced options'', 1;'); | |
EXEC ('RECONFIGURE'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- 1 Show Work In Process | |
--- Ignore me - This is not the query you are looking for | |
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED | |
USE master | |
GO | |
SET NOCOUNT ON | |
SET QUOTED_IDENTIFIER ON | |
SELECT |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
HostName, | |
"OS UserName", | |
Login, | |
spid, | |
"Database", | |
TableID, | |
"Table Name", | |
IndID, | |
"Lock Type", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DECLARE @Starttime DATETIME | |
DECLARE @EndTime DATETIME | |
SET @Starttime = DATEADD(hour ,-1,GETDATE()) | |
SET @Endtime = GETDATE() | |
DROP TABLE IF EXISTS #query1 | |
--- Max Duration | |
SELECT TOP (100) | |
p.query_id query_id, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ATTENTION - This was Updated November 25, 2024 | |
# The new [microsoft.data.sqlclient] provider allows new features such as | |
# New Azure AD Authentication Methods | |
# BulkCopy Speedups | |
# DNS Resiliency | |
# Data Classification | |
# UTF-8 Support | |
# Connection Statistics - | |
# https://docs.microsoft.com/en-us/sql/connect/ado-net/sql/provider-statistics-sql-server?view=sql-server-ver15 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://vexx32.github.io/2018/10/26/Anonymous-Functions/ | |
function Retry() | |
{ | |
param( | |
[Parameter(Mandatory=$true)][Action]$action, | |
[Parameter(Mandatory=$false)][int]$maxAttempts = 3 | |
) | |
$attempts=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Download the CLI Version of NuGet | |
https://dist.nuget.org/win-x86-commandline/latest/nuget.exe | |
--Create Work Paths | |
md c:\nuget | |
md c:\nuget\source | |
md c:\nuget\publish | |
-- One-Time - Create local NuGet Repo/feed using a local drive path | |
cd c:\nuget |