Skip to content

Instantly share code, notes, and snippets.

View drconopoima's full-sized avatar

Luis Jesús Díaz drconopoima

View GitHub Profile
@drconopoima
drconopoima / sp_help_revlogin2.sql
Created December 16, 2025 11:38 — forked from EitanBlumin/sp_help_revlogin2.sql
sp_help_revlogin2 is a simpler alternative to sp_help_revlogin
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/
@drconopoima
drconopoima / transfer-login.sql
Created December 16, 2025 11:38 — forked from sdwh/transfer-login.sql
[SQL Server Transfer Logins Passwords] #SQLServer
USE master
GO
IF OBJECT_ID ('sp_hexadecimal') IS NOT NULL
DROP PROCEDURE sp_hexadecimal
GO
CREATE PROCEDURE sp_hexadecimal
@binvalue varbinary(256),
@hexvalue varchar (514) OUTPUT
AS
DECLARE @charvalue varchar (514)
# Export current jobs to scripts
Get-DbaAgentJob -SqlInstance $OldInstance | Where-Object {-not $_.isenabled} | ForEach-Object {Export-DbaScript $_ -Path (Join-Path -Path s:\Temp\2016Migration\DisabledJobs -Childpath "$($_.name.replace('\','$')).sql")};
Get-DbaAgentJob -SqlInstance $OldInstance | Where-Object {$_.isenabled} | ForEach-Object {Export-DbaScript $_ -Path (Join-Path -Path s:\Temp\2016Migration\EnabledJobs -Childpath "$($_.name.replace('\','$')).sql")};
# Get only the enabled job
$JobsToCopy = Get-DbaAgentJob -SqlInstance $OldInstance -ExcludeDisabledJobs;
# Copy the Operator(s) from the existing server
Copy-DbaAgentOperator -Source $oldinstance -Destination $newinstance;
@drconopoima
drconopoima / answers.md
Created January 21, 2026 10:33 — forked from potatoqualitee/answers.md
answers.md

Something we appreciate about PowerShell and dbatools is that there are often a number of perfectly valid ways to solve the same problem. Considering this, some of the questions have multiple answers.

Some answers are different ways to express the same solution.

Chapter 2

Find all commands that have DbaReg in their name.

Get-Command *dbareg* -Module dbatools
# or
ARG TARGET_OS=linux
ARG TARGET_ARCH=amd64
ARG FROM_REPOSITORY='docker.io/library'
ARG FROM_IMAGE_BASE='ubuntu'
ARG FROM_IMAGE_TAG='resolute'
FROM ${FROM_REPOSITORY}/${FROM_IMAGE_BASE}:${FROM_IMAGE_TAG}
ARG UTILS_USER_GID=888888
ARG UTILS_USER_UID=888888
@drconopoima
drconopoima / practice-test.md
Created June 21, 2026 11:37
Generate Practice Test & mock exam questions from a desired curriculum input (text, webpage, PDF, URLs).

name: practice-test-mock-exam description: "Generate Practice Test & mock exam questions from a desired curriculum input (text, webpage, PDF, URLs). Produces completely accurate, real exam-like questions in interactive mode delivered one-by-one, detail-oriented design to probe concept-awareness with proper explanations and randomized options order" tags: ["exam", "exam-prep", "mock-exam", "practice-test", "questions", "certification", "education"] triggers:

  • practice test
  • practice test
  • exam questions
  • generate practice test
  • certification exam questions