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
<xml version="1.0" encoding="utf-8" standalone="yes"?>
<!--
RedGate.SQLCompare.UI
RedGate.SQLCompare.UI
Version:14.5.2.18630-->
<NamedFilter version="1" type="SQLCompareFilter">
<!--This filter can be loaded using the SQL Compare UI or used with a SQL Compare command line session using the /filter switch-->
<FilterName>SQLCompareFilterExcludingUsers</FilterName>
<Filter version="1" type="DifferenceFilter">
<FilterCaseSensitive>False</FilterCaseSensitive>
@LitKnd
LitKnd / test.sql
Created October 17, 2020 13:39
i can add a script
select * from sys.databases
USE master;
GO
sp_configure 'show advanced options', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
sp_configure 'contained database authentication', 1;
GO
RECONFIGURE WITH OVERRIDE;
GO
SET QUOTED_IDENTIFIER ON;
GO
SET ANSI_NULLS ON;
GO
/*******************************************
The code for this function contains extra steps, because SQL Server
does not allow you to alter a function if it is referenced by a default constraint
******************************************/
#Modified from: https://documentation.red-gate.com/clone/automation/git-hooks
##########################################################################################
############################## clone-branch.ps1 version 0.2 ##############################
##########################################################################################
##################################### Configuration ######################################
#$VerbosePreference = "Continue" # Uncomment this line to enable verbose logging
$InformationPreference = "Continue" # Comment this line to disable information logging
USE master;
GO
IF DB_ID('SchemaDeployDev') IS NOT NULL
BEGIN
ALTER DATABASE SchemaDeployDev SET SINGLE_USER WITH ROLLBACK IMMEDIATE;
DROP DATABASE SchemaDeployDev;
END;
USE master;
GO
SET NOCOUNT ON;
GO
/*******************************************
Set up the database and table
********************************************/
CREATE DATABASE QuickTest
GO
USE QuickTest;
GO
CREATE CERTIFICATE SelfSignedCertificate
ENCRYPTION BY PASSWORD = 'helloiamapassword123'
WITH SUBJECT = 'Self Signed Cert Test',
SELECT s.name AS [ReferencingSchemaName],
oa.name AS [ReferencingObjectName],
oa.type_desc AS [ReferencingObjectType],
d.referenced_schema_name AS [ReferencedSchemaName],
da.name AS [ReferencedObjectName],
da.type_desc AS [ReferencedObjectType]
FROM sys.sql_expression_dependencies d
LEFT JOIN sys.all_objects oa
use master;
GO
SET NOCOUNT ON;
GO
IF DB_ID('Partitioning') IS NOT NULL
BEGIN
ALTER DATABASE Partitioning SET SINGLE_USER WITH ROLLBACK IMMEDIATE;