Skip to content

Instantly share code, notes, and snippets.


Aaron Nelson SQLvariant

View GitHub Profile
View Gui-SSRS-Deploy.ps1
# Source File Information (DO NOT MODIFY)
# Source ID: 9ad32074-7adb-4822-a049-93600f966aa9
# Source File: ..\Documents\SAPIEN\Projects\Gui-SSRS-Deploy\Gui-SSRS-Deploy.psproj
#region Project Recovery Data (DO NOT MODIFY)
View GetSQLBuffers_wProvider_PipeTo_Out-SquarifiedTreeMap.ps1
<# This is the code used to tell you
which databases are using up the RAM on
your SQL Server is great information to know
Queries are from #>
$SQLInstance = 'localhost\SQL2016'
Invoke-Sqlcmd -ServerInstance $SQLInstance -Database master -Query "
DECLARE @total_buffer INT;
SELECT @total_buffer = cntr_value
View Deploy-Reports.ps1
[String] [Parameter(Mandatory)]
#this is the evironment that is in the Solution config to read where things need to go (TEST/DEV/QA/Prodution)
#for example - C:\tfs2013\Test Automated Deployment Sharepoint.rptproj
[string] [Parameter(Mandatory)] $Environment,
#this is the name of the Datasource as it exists in Sharepoint without the .rsds extension
[string] [Parameter(Mandatory)] $DataSource,
#This is the connection string that will be set for the report data source.
View SQLReporting.psm1
# SQLReporting.psm1 Version 0.9
# Written by Trond Hindenes
#Import-Module Pester
Gets SSRS instances on ComputerName
rjmholt / CellFindingVisitor.cs
Created Aug 11, 2020
PowerShell AST visitor to break up a file by comments
View CellFindingVisitor.cs
using System;
using System.Collections.Generic;
using System.Management.Automation.Language;
public class ScriptExtent : IScriptExtent
private readonly IScriptPosition _start;
private readonly IScriptPosition _end;
View SubScriptionExporter.ps1
#Requires -Version 5.0
# Source File Information (DO NOT MODIFY)
# Source ID: 8967ce63-8512-4998-b597-b65331d6a9f6
# Source File: subscriptionExporter.psf
#region File Recovery Data (DO NOT MODIFY)
View sql-messages-without-whitespaces.sql
-- TRANSLATE() and STRING_SPLIT() work with SQL Server 2016+, STRING_AGG() with 2017+.
-- language_id=1033 is English (simplified)
SELECT STRING_AGG(REPLACE(TRANSLATE(s.[value] COLLATE database_default, '():.,-/='';', '**********'), '*', ''), ' ')
FROM sys.messages AS msg
CROSS APPLY STRING_SPLIT(msg.[text], ' ') AS s
WHERE msg.language_id=1033
--AND s.[value] COLLATE database_default NOT IN ('the', 'is', 'to', 'not', 'a', 'for', 'in', 'be', 'of', 'or', 'cannot', 'and')
AND s.[value] COLLATE database_default NOT LIKE '%[%@=]%'
GROUP BY msg.message_id
SQLvariant / Query_DB2.ps1
Created Nov 20, 2020
Uploaded via PowerShell
View Query_DB2.ps1
#Define connection string for the database
$cn = new-object"server=$($server);Provider=IBMDADB2;DSN=$($dbName);trusted_connection=true;");
#Define data set for first query
$ds = new-object "System.Data.DataSet" "ds"
#Define query to run
$q = "select * from hello_world"
# Define data object given the specific query and connection string
AndyCross / BabylonjsVisual.ts
Last active Dec 6, 2020
Use BabylonJS in PowerBI
View BabylonjsVisual.ts
declare module BABYLON {
export class Engine {
constructor(canvas:HTMLElement, antialias:boolean);
export class Scene {
stummsft / Set-SqlTlsCertificate.ps1
Created Apr 5, 2019
Programmatically set the TLS certificate to be used by a given SQL Server Instance
View Set-SqlTlsCertificate.ps1
function Set-SqlTlsCertificate {
param (
[Alias("CN", "MachineName")]
[String[]]$ComputerName = "localhost",