🕵️♂️
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
SET SHOWPLAN_XML ON; | |
GO | |
/* TODO: Add your test query here to get its estimated plan WITHOUT the hypothetical indexes */ | |
GO | |
SET SHOWPLAN_XML OFF; | |
GO |
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
---------------------------------------------------------------- | |
-------- Ultimate Compression Savings Estimation Check --------- | |
---------------------------------------------------------------- | |
-- Author: Eitan Blumin | https://www.eitanblumin.com | |
-- Create Date: 2019-12-08 | |
-- Source: http://bit.ly/SQLCompressionEstimation | |
-- Full Link: https://gist.github.com/EitanBlumin/85cf620f7267b234d677f9c3027fb7ce | |
-- GitHub Repo: https://github.com/MadeiraData/MadeiraToolbox/blob/master/Utility%20Scripts/ultimate_compression_savings_estimation_whole_database.sql | |
-- Blog: https://eitanblumin.com/2020/02/18/ultimate-compression-savings-estimation-script-entire-database/ | |
---------------------------------------------------------------- |
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
/* | |
Check that the configured value for MAXDOP is in the recommended range, as described in this KB article: | |
https://support.microsoft.com/en-us/help/2806535/recommendations-and-guidelines-for-the-max-degree-of-parallelism-confi | |
If @WhatIf = 0 then MAXDOP will automatically be changed to the recommended setting. | |
*/ | |
-- change this to 1 to only display findings without actually changing the config: | |
DECLARE @WhatIf BIT = 0; | |
-------------------------------------- |
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
/*********************************************************************************** | |
Copyright: Eitan Blumin (c) 2018 | |
https://gist.github.com/EitanBlumin/79222fc2be5163cec828d0a69270a0ab | |
***********************************************************************************/ | |
-- TODO: Rename the _NEW object names to their original names (primary key, default and check constraints) | |
-- TODO: Identify constraints with NOCHECK | |
GO | |
IF OBJECT_ID('tempdb..#PrintMax', 'P') IS NOT NULL DROP PROCEDURE #PrintMax; |
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
param ( | |
[string] $SourceFolder = "SSRS", | |
[string] $TargetReportServerUri = "http://localhost/ReportServer", | |
[string] $TargetFolder = "MyReports" | |
) | |
$ErrorActionPreference = "Stop" | |
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12 | |
Install-Module PowerShellGet -RequiredVersion 2.2.4 -SkipPublisherCheck |
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
/* | |
Author: Eitan Blumin, (t: @EitanBlumin | b: eitanblumin.com) | |
Date: February, 2018 | |
Description: | |
The data returned by the script would be a list of execution plans, | |
their respective SQL statements, the Sub-Tree cost of the statements, and their usecounts. | |
Using this script, you will be able to identify execution plans that use parallelism, | |
which may stop using parallelism if you change “cost threshold for parallelism” to a value |
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
/* | |
Author: Eitan Blumin | https://eitanblumin.com | https://madeiradata.com | |
Date Created: 2018-01-02 | |
Last Update: 2023-06-18 | |
Description: | |
Fix All Orphaned Users Within Current Database, or all databases in the instance. | |
Handles 3 possible use-cases: | |
1. Login with same name as user exists - generate ALTER LOGIN to map the user to the login. | |
2. Login with a different name but the same sid exists - generate ALTER LOGIN to map the user to the login. | |
3. Login SID is identifiable but login doesn't exist in SQL - generate CREATE LOGIN FROM WINDOWS to create a Windows authentication login. |
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
param ( | |
[Parameter(Mandatory)][string] $GitHubToken, | |
[Parameter(Mandatory)][string] $GitHubOwner, | |
[Parameter(Mandatory)][string] $GitHubRepo, | |
[Parameter(Mandatory)][string] $SourceTrelloJsonFile, | |
[string[]] $TrelloLists, | |
[bool] $UpdateExistingIssuesByTitle = $true, | |
[bool] $AddNonExistingIssues = $true, | |
[bool] $Logging = $true | |
) |
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://learn.microsoft.com/en-us/sql/t-sql/statements/alter-table-transact-sql?view=sql-server-ver16#switch--partition-source_partition_number_expression--to--schema_name--target_table--partition-target_partition_number_expression- | |
*/ | |
SET NOCOUNT ON; | |
GO | |
CREATE PARTITION FUNCTION PF1 (int) AS RANGE RIGHT FOR VALUES (0, 100) | |
CREATE PARTITION SCHEME PS1 AS PARTITION PF1 ALL TO ([PRIMARY]); | |
GO | |
CREATE PARTITION FUNCTION PF2 (int) AS RANGE RIGHT FOR VALUES (0, 100, 200) | |
CREATE PARTITION SCHEME PS2 AS PARTITION PF2 ALL TO ([PRIMARY]); |
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
/************************************************************************** | |
Check Index Fragmentation based on Page Fullness and Fill Factor | |
*************************************************************************** | |
Author: Eitan Blumin | https://www.eitanblumin.com | |
Version History: | |
2020-10-20 Added @MaxDOP parameter, and better comments & indentation | |
2020-01-07 First version | |
Description: | |
This script was inspired by Erik Darling's blog post here: |
NewerOlder