🕵️♂️
This file contains hidden or 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 hidden or 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, 2019 | |
Description: | |
This is a condensed SQL Server Checkup of most common and impactful best practices. | |
Some of the checks are based on BP_Check.sql in Tiger Toolbox (by Pedro Lopez) | |
*/ | |
DECLARE | |
@NumOfMinutesBackToCheck INT = 360, | |
@MinutesBackToCheck INT = 360, |
This file contains hidden or 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
/************** Find Orphaned Records ************** | |
Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com) | |
More info: https://eitanblumin.com/2018/11/06/find-and-fix-untrusted-foreign-keys-in-all-databases/ | |
****************************************************/ | |
DECLARE | |
@ForeignKeyName SYSNAME = 'FK_MyTable_MyOtherTable' | |
, @PrintOnly BIT = 0 | |
DECLARE | |
@FKId INT, |
This file contains hidden or 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 @MinutesBackToCheck INT = 10; | |
SET NOCOUNT ON; | |
DECLARE @start DATETIME; | |
SET @start=DATEADD(MINUTE,-@MinutesBackToCheck,GETDATE()); | |
DECLARE @errors AS TABLE | |
( | |
ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED, | |
LogDate DATETIME, |
This file contains hidden or 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 hidden or 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
/* | |
Fully Parameterized Search Query | |
-------------------------------- | |
Copyright Eitan Blumin (c) 2018; email: [email protected] | |
You may use the contents of this SQL script or parts of it, modified or otherwise | |
for any purpose that you wish (including commercial). | |
Under the single condition that you include in the script | |
this comment block unchanged, and the URL to the original source, which is: | |
http://www.eitanblumin.com/ |
This file contains hidden or 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 hidden or 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 hidden or 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
/****************************************************************** | |
Parse SQL Vulnerability Assessment Tool Results | |
*********************************************** | |
Author: Eitan Blumin | https://www.eitanblumin.com | |
Description: | |
Use this script to parse a Vulnerability Assessment Tool | |
results file into a relational structure. | |
This will output the T-SQL queries used by VAT behind the scenes | |
and their respective meta-data, as displayed in the VAT. |