🕵️♂️
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
/* | |
Author: Eitan Blumin (t: @EitanBlumin | b: eitanblumin.com) | |
Date: November, 2018 | |
Description: | |
Update @@SERVERNAME to Actual Machine Name. | |
Run as-is. The script is idempotent and requires no parameters. | |
SQL Service restart may be required in order to apply changes. | |
More info: | |
https://eitanblumin.com/2018/11/06/how-to-update-servername-to-actual-machine-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
param | |
( | |
[string] $PrimaryNinja = "Jane Doe", | |
[string] $SecondaryNinja = "John Smith" | |
) | |
$global:zendesk_user_name = "[email protected]/token" # The /token part is obligatory when using Zendesk's API | |
$global:zendesk_password = "put_your_zendesk_API_token_here" | |
$global:zendesk_address = "https://your_zendesk_subdomain_here.zendesk.com" | |
$global:primarySLAgroupname = "SLA 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
/* | |
Fully Parameterized Search Query | |
-------------------------------- | |
Copyright Eitan Blumin (c) 2014; 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.madeiradata.com/author/eitan/ |
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 AdventureWorks2008R2 | |
GO | |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
IF OBJECT_ID('Purchasing.usp_AT_uPurchaseOrderDetail', 'P') IS NOT NULL | |
DROP PROCEDURE Purchasing.usp_AT_uPurchaseOrderDetail; | |
GO | |
CREATE PROCEDURE Purchasing.usp_AT_uPurchaseOrderDetail |
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
/* | |
=================================================== | |
Service Broker Sample 1: Parallel Querying | |
=================================================== | |
Copyright: Eitan Blumin (C) 2012 | |
Email: [email protected] | |
Source: www.madeira.co.il | |
Disclaimer: | |
The author is not responsible for any damage this | |
script or any of its variations may cause. |
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: August, 2015 | |
Description: | |
Use this script to easily roll forward multiple transaction log backups from a given folder. | |
More info: | |
https://eitanblumin.com/2018/10/28/t-sql-script-to-roll-forward-transaction-log-backups | |
*/ | |
DECLARE |
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 MERGE Statements for All Tables | |
=================================================== | |
Copyright: Eitan Blumin (C) 2012 | |
Email: [email protected] | |
Source: www.madeiradata.com | |
Disclaimer: | |
The author is not responsible for any damage this |
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
USE master | |
GO | |
-- Using SQL Error Logs: | |
xp_readerrorlog 0, 1, N'Server is listening on', N'any', NULL, NULL, N'asc' | |
-- will also return records for DB Mirroring endpoints | |
-- also, this won't work if error log was cycled | |
GO | |
-- Using currently connected connections: |
OlderNewer