Skip to content

Instantly share code, notes, and snippets.

View srutzky's full-sized avatar
🏠
Working from home

Solomon Rutzky srutzky

🏠
Working from home
View GitHub Profile
@Sebazzz
Sebazzz / CollationBugRepro.sql
Created January 14, 2017 11:41
Repro for bug of collation issue in SQL Server 2012 (see: http://dba.stackexchange.com/q/160975/114952). Repro also on localdb v11.
/****** Object: Database [CollationTest] Script Date: 14-1-2017 12:40:46 ******/
CREATE DATABASE [CollationTest]
CONTAINMENT = NONE
ON PRIMARY
( NAME = N'CollationTest', FILENAME = N'C:\Users\Sebastiaan\CollationTest.mdf' , SIZE = 4096KB , MAXSIZE = UNLIMITED, FILEGROWTH = 1024KB )
LOG ON
( NAME = N'CollationTest_log', FILENAME = N'C:\Users\Sebastiaan\CollationTest_log.ldf' , SIZE = 1024KB , MAXSIZE = 2048GB , FILEGROWTH = 10%)
GO
ALTER DATABASE [CollationTest] SET COMPATIBILITY_LEVEL = 110
GO
@vszakats
vszakats / codesign.sh
Last active May 9, 2024 10:23
Code-signing PE executables using OpenSSL, osslsigncode (and more)
#!/bin/sh
# To the extent possible under law, Viktor Szakats
# has waived all copyright and related or neighboring rights to this
# script.
# CC0 - https://creativecommons.org/publicdomain/zero/1.0/
# SPDX-License-Identifier: CC0-1.0
# shellcheck disable=SC3040,SC2039
set -o errexit -o nounset; [ -n "${BASH:-}${ZSH_NAME:-}" ] && set -o pipefail
@sheldonhull
sheldonhull / ParseTextUsingCLR.sql
Created July 14, 2016 15:26
Parsing match from text using SQL# (SqlSharp) CLR function
declare @StuckGum as table (
message varchar(1000) not null
);
insert into @StuckGum
( message )
-- Data generated by http://bit.ly/29GsjgG thanks for such a great resource for cool randomized data
values
( 'A media personality named Hou Pu-Sho needs a 4:37: team to abduct and extract Arsem Tchinova, the head of newLink Unlimited. Further, security is already on alert because of a previous botched run.' )
, ( 'A charming corporate agent named Dara Yenkotov needs a 2:41: team to abduct and extract Take Kuri, the head of Paronki-Puchkora Multinational. Further, security is already on alert because of a previous botched run.' )
, ( 'A guarded media personality named Tobias McRaven needs a 8:37: team to abduct and extract Nouchi Sumi, the head of priSoft Consolidated. However, he cannot provide any usual form of compensation.' )
@dalenewman
dalenewman / gist:6377911
Last active August 16, 2023 15:08
A T-SQL stored procedure for moving an index from one file group to another. The original script was found at http://blogs.msdn.com/b/ramoji/archive/2008/09/26/how-to-move-existing-indexes-from-one-filegroup-to-another.aspx and updated according to responses found on the same page.
IF EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[MoveIndexToFileGroup]') AND type in (N'P', N'PC'))
BEGIN
DROP PROCEDURE [dbo].[MoveIndexToFileGroup]
END
GO
CREATE PROC [dbo].[MoveIndexToFileGroup] (
@DBName sysname,
@SchemaName sysname = 'dbo',
@ObjectNameList Varchar(Max),