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
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 |
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 | |
--reset demo | |
DROP TABLE IF EXISTS dbo.child, | |
dbo.parent; | |
GO | |
CREATE TABLE dbo.parent | |
( |
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
<# | |
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', |
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 [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' |
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
/***************************************************************************** | |
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 |
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
[ | |
{ | |
"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"] | |
} | |
}, | |
] |
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
/***************************************************************************** | |
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, |
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
/***************************************************************************** | |
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 ( |
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
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; |
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
/***************************************************************************** | |
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 |