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 [Wordle]; | |
GO | |
DROP TABLE IF EXISTS #KnownLetters, #AllAnswers; | |
GO | |
DECLARE | |
@known_letters AS varchar(5), | |
@excluded_letters AS varchar(26), | |
@position1 AS char(1), |
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
/* Create table */ | |
IF NOT EXISTS | |
( | |
SELECT * | |
FROM [sys].[tables] AS [t] | |
JOIN [sys].[schemas] AS [s] | |
ON [t].[schema_id] = [s].[schema_id] | |
WHERE | |
[t].[name] = N'WordleAnswers' | |
AND [s].[name] = N'dbo' |
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
DECLARE | |
@job_sql AS nvarchar(max), | |
@job_name AS nvarchar(128) = N'syspolicy_purge_history', -- = N'No existy', | |
@debug_mode_on AS bit = 1; -- 0; | |
DECLARE | |
@nl AS nchar(2), | |
@actual_job_name AS nvarchar(128); | |
/* Newline for formatting */ |
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
package main | |
import ( | |
"database/sql" | |
"fmt" | |
"log" | |
// this is the driver & yes, even though we're throwing | |
// it away to `_`, it's still needed | |
_ "github.com/denisenkom/go-mssqldb" |
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 tempdb; | |
GO | |
IF OBJECT_ID(N'dbo.LollerCoaster', N'U') IS NOT NULL BEGIN | |
DROP TABLE dbo.LollerCoaster; | |
END; | |
GO | |
CREATE TABLE dbo.LollerCoaster ( | |
loller_coaster_id tinyint IDENTITY(1, 1) NOT NULL, | |
loller_coaster_stage varchar(4000) NOT NULL | |
); |
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
describe 'testing our function with scriptroot' { | |
# Get our self contained script info. | |
. .\Get-FunctionInfo.ps1 | |
$fInfo = Get-FunctionInfo -Path .\Get-NameScriptBlock.ps1 | |
# Create something we can dot-source. | |
$Fake = "function $($fInfo.Name) { $($fInfo.Definition) }" | |
$FakeFunc = [scriptblock]::Create($Fake) | |
. $FakeFunc |
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
function Get-Name { | |
[CmdletBinding()] | |
param( | |
[String]$Name = 'you' | |
) | |
'Hello, {0}. Script root is {1}' -f $Name, $PSScriptRoot | |
} | |
Get-Name -Name Shane |
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
DECLARE @XmlStoredAsNvarchar nvarchar(4000) = ' | |
<EventContext> | |
<eventType>Save Test Data</eventType> | |
<discipline>Operations</discipline> | |
<documentNumber>1.2.3.4</documentNumber> | |
<documentVersion>1.0</documentVersion> | |
<sectionNumber>1.2.1.1</sectionNumber> | |
<sectionName>Test section: XML Test</sectionName> | |
<tableIdentifier>1</tableIdentifier> | |
<objectType>Object</objectType> |
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
DECLARE @XmlStoredAsNvarchar nvarchar(4000) = ' | |
<EventContext> | |
<eventType>Save Test Data</eventType> | |
<discipline>Operations</discipline> | |
<documentNumber>1.2.3.4</documentNumber> | |
<documentVersion>1.0</documentVersion> | |
<sectionNumber>1.2.1.1</sectionNumber> | |
<sectionName>Test section: XML Test</sectionName> | |
<tableIdentifier>1</tableIdentifier> | |
<objectType>Object</objectType> |
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
DECLARE @XmlStoredAsNvarchar nvarchar(4000) = ' | |
<EventContext> | |
<eventType>Save Test Data</eventType> | |
<discipline>Operations</discipline> | |
<documentNumber>1.2.3.4</documentNumber> | |
<documentVersion>1.0</documentVersion> | |
<sectionNumber>1.2.1.1</sectionNumber> | |
<sectionName>Test section: XML Test</sectionName> | |
<tableIdentifier>1</tableIdentifier> | |
<objectType>Object</objectType> |
NewerOlder