🕵️♂️
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
------------------------------------------------------- | |
------ Generate Clustered Index Recommendations ------- | |
------------------------------------------------------- | |
-- Author: Eitan Blumin | https://www.eitanblumin.com | |
-- More info: https://eitanblumin.com/2019/12/30/resolving-tables-without-clustered-indexes-heaps/ | |
------------------------------------------------------- | |
-- Description: | |
-- ------------ | |
-- This script finds all heap tables, and "guestimates" a clustered index recommendation for each. | |
-- The script implements the following algorithm: |
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
IF OBJECT_ID('tempdb..#PrintMax') IS NOT NULL DROP PROC #PrintMax; | |
GO | |
/* | |
Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com) | |
Description: | |
This is a minified version of the PrintMax procedure (originally written by Ben Dill). | |
It's created as a temporary procedure. | |
*/ | |
CREATE PROCEDURE #PrintMax @str NVARCHAR(MAX) | |
AS |
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
# Adventure Works SQL Database Project Build Configuration | |
trigger: | |
- master | |
pool: | |
vmImage: 'VS2017-Win2016' | |
variables: | |
solution: '**/*.sln' |
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
/**************************************************************************************************/ | |
/* Generate Procedure Unit Test with Automatic Comparison */ | |
/**************************************************************************************************/ | |
-- Author: Eitan Blumin | |
-- Date: 2018-11-21 | |
-- Description: Use this script to generate and run a "unit test" for two stored procedures. | |
-- Each procedure is considered to be affecting one or more database tables. | |
-- The contents of these tables can be compared before and after each unit test, | |
-- and the results of each of the two stored procedures can be compared. |
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
---------------------------------------------------------------------------------- | |
-- Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com) | |
-- Date: 26/06/18 | |
-- Description: | |
-- Compares server level objects and definitions as outputted by the first script (InstancePropertiesGenerateForCompare.sql). | |
-- | |
-- Instructions: | |
-- Run InstancePropertiesGenerateForCompare.sql on each server. Save output to a CSV file. | |
-- Use this script ( InstancePropertiesComparison.sql ) to load the files into a table, and output any differences | |
-- Don't forget to change file paths accordingly. |
NewerOlder