🕵️♂️
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
/* | |
Asynchronous Ledger Demo | |
======================== | |
Author: Eitan Blumin | https://eitanblumin.com | https://madeiradata.com | |
Date: 2021-07-03 | |
Description: | |
This script demonstrates a use case of a high-throughput table | |
which serves as a "hot-spot" for inserts and updates and queries. | |
This causes performance problems due to long lock chains, possible deadlocks, | |
and sometimes even worker thread starvation. |
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
/* | |
================================================ | |
Extended Properties as Database Global Variables | |
================================================ | |
Author: Eitan Blumin | https://madeiradata.com | https://eitanblumin.com | |
Date: 2021-06-04 | |
Description: | |
Use this sample script as a template or starting point | |
for when you want to utilize extended properties | |
to save and retrieve values as if using "global" variables |
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..#sp_help_revlogin2') IS NOT NULL DROP PROCEDURE #sp_help_revlogin2 | |
GO | |
/********************************************************************************************* | |
sp_help_revlogin2 V1.2 | |
Eitan Blumin | |
https://eitanblumin.com | https://madeiradata.com | |
https://gist.github.com/EitanBlumin/1f19b0b3f59a9220641c559653b90f15 | |
https://github.com/MadeiraData/MadeiraToolbox/blob/master/Utility%20Scripts/sp_help_revlogin2.sql | |
https://eitanblumin.com/2021/05/11/t-sql-tuesday-138-sp_help_revlogin-is-dead-long-live-sp_help_revlogin2/ |
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..#sp_DBPermissions') IS NOT NULL DROP PROCEDURE #sp_DBPermissions | |
GO | |
/********************************************************************************************* | |
sp_DBPermissions V6.1 | |
Kenneth Fisher | |
http://www.sqlstudies.com | |
https://github.com/sqlstudent144/SQL-Server-Scripts/blob/master/sp_DBPermissions.sql | |
This stored procedure returns 3 data sets. The first dataset is the list of 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('#sp_SrvPermissions') IS NOT NULL DROP PROCEDURE #sp_SrvPermissions | |
GO | |
/********************************************************************************************* | |
sp_SrvPermissions V6.1 | |
Kenneth Fisher | |
http://www.sqlstudies.com | |
https://github.com/sqlstudent144/SQL-Server-Scripts/blob/master/sp_SrvPermissions.sql | |
This stored procedure returns 3 data sets. The first dataset is the list of server |
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 | |
Description: | |
This is the simplest possible alternative to sp_MSforeachdb which is not too great. | |
Instructions: | |
1. Replace the contents of the @Command variable with the command you want to run INSIDE each database. | |
2. Replace the contents of the @Parameters variable with the parameters you want the command to receive. | |
3. Add parameters as needed, given @p1 as an example. | |
4. Change the database filter predicates in the cursor declaration, as needed. |
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
<# | |
.SYNOPSIS | |
Script to configure load balancer listener IP and name for a domain-independent Availability Group in a Windows Workgroup | |
Author: Eitan Blumin | |
Date: 2021-01-20 | |
.DESCRIPTION | |
This script is adapted from the scripts provided in the following resources: |
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
############## Setup ############## | |
$AGName = '' | |
$AGPrimary = '' | |
$AGSecondary = '' | |
# This allows you to process just a subset of databases using the name (wildcards are possible) | |
$DBNamePattern = 'AdventureW*' | |
$TargetFolder = 'K:\Data\' |
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
USE SentryOne | |
GO | |
DECLARE | |
@SiteName NVARCHAR(1000) = NULL | |
,@SqlServerName NVARCHAR(1000) = NULL | |
,@End_date DATETIME = NULL | |
,@Start_date DATETIME = NULL | |
,@CounterID SMALLINT = 1858 -- CPU % | |
,@DefaultDaysBack INT = 90 |
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
/* | |
Retrieve Foreign Key Hierarchy Tree | |
=================================== | |
Author: Eitan Blumin | https://eitanblumin.com | https://madeiradata.com | |
Date: 2021-01-07 | |
Description: | |
Retrieve the hierarchy tree for a given table, | |
based on foreign key references. | |
Use this script to map out your entity relational structure, | |
see which foreign keys are dependent on a given table, |