Skip to content

Instantly share code, notes, and snippets.

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

Kendra Little LitKnd

🏠
Working from home
View GitHub Profile
@LitKnd
LitKnd / Mmmm_Chocolatey.ps1
Last active February 22, 2024 09:11 — forked from SQLvariant/Mmmm_Chocolatey.ps1
Install SQL / Data Developer Desktop Tools from Chocolatey
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 -y #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
USE tempdb;
GO
--reset demo
DROP TABLE IF EXISTS dbo.child,
dbo.parent;
GO
CREATE TABLE dbo.parent
(
<#
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',
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'
/*****************************************************************************
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
[
{
"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"]
}
},
]
/*****************************************************************************
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,
/*****************************************************************************
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 (
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;
/*****************************************************************************
Copyright (c) 2017 SQL Workbooks LLC
MIT License, http://www.opensource.org/licenses/mit-license.php
Get WideWorldImporters-Full.bak from Microsoft at:
https://github.com/Microsoft/sql-server-samples/releases/tag/wide-world-importers-v1.0
******************************************************************************/
USE master;
GO