Skip to content

Instantly share code, notes, and snippets.

Kendra Little LitKnd

Block or report user

Report or block LitKnd

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View partition-right-dates.sql
use master;
GO
SET NOCOUNT ON;
GO
IF DB_ID('Partitioning') IS NOT NULL
BEGIN
ALTER DATABASE Partitioning SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
@LitKnd
LitKnd / Mmmm_Chocolatey.ps1
Last active Dec 5, 2019 — forked from SQLvariant/Mmmm_Chocolatey.ps1
Install SQL / Data Developer Desktop Tools from Chocolatey
View Mmmm_Chocolatey.ps1
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install chocolatey -y
choco install sql-server-2017 #developer edition
choco install sql-server-management-studio -y
choco install azure-data-studio -y
choco install azuredatastudio-powershell -y
choco install git.install -y
choco install poshgit -y
View Simple foreign key example.sql
USE tempdb;
GO
--reset demo
DROP TABLE IF EXISTS dbo.child,
dbo.parent;
GO
CREATE TABLE dbo.parent
(
View BuildAndDeploy-SCA-StackOverflow
<#
More examples of PowerShell commands for Continuous Integration:
https://documentation.red-gate.com/sca3/automating-database-changes/continuous-integration
#>
param
(
[string]$project = 'C:\git\StackOverflow\StackOverflow',
[string]$packageVersion = '0.0.001',
[string]$packageID = 'SO',
View Restore_AdventureWorks2017.sql
USE [master];
GO
IF DB_ID('AdventureWorks2017') IS NOT NULL
BEGIN
ALTER DATABASE AdventureWorks2017 SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE AdventureWorks2017;
END;
RESTORE DATABASE [AdventureWorks2017]
FROM DISK = N'S:\MSSQL\BACKUP\AdventureWorks2017.bak'
View Heap when were statistics last updated.sql
/*****************************************************************************
MIT License, http://www.opensource.org/licenses/mit-license.php
Contact: help@sqlworkbooks.com
Copyright (c) 2018 SQL Workbooks LLC
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or
sell copies of the Software, and to permit persons to whom
View Default-sublime-commands
[
{
"caption": "Reg Replace: Format VTT",
"command": "reg_replace",
"args": {"replacements": ["remove_timestamps", "remove_numbered_lines","remove_empty_lines","remove_line_endings","remove_WEBVTT_literal","remove_v_tags"]
}
},
]
View An Order By Puzzle.sql
/*****************************************************************************
MIT License, http://www.opensource.org/licenses/mit-license.php
Contact: help@sqlworkbooks.com
Copyright (c) 2018 SQL Workbooks LLC
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
View sp_indexdetails.sql
/*****************************************************************************
Copyright (c) 2018 SQL Workbooks LLC
MIT License, http://www.opensource.org/licenses/mit-license.php
Contact: help@sqlworkbooks.com
*****************************************************************************/
USE master;
GO
CREATE OR ALTER PROCEDURE dbo.sp_indexdetails (
View sp_query_store_flush_db.sql
SET NOCOUNT ON;
GO
USE master;
GO
IF DB_ID('QueryStoreTest') IS NOT NULL
BEGIN
ALTER DATABASE QueryStoreTest SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE QueryStoreTest;
You can’t perform that action at this time.