View Testing.sql
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
CREATE TABLE myTable (col1 varchar(2)) | |
INSERT INTO myTable ('ts'); | |
GO |
View Testing
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
$os = Get-ItemProperty 'HKLM:\Software\Microsoft\Windows NT\CurrentVersion' -ErrorVariable $osinfoError | |
$osInfoData = [pscustomobject]@{ | |
"ProductName" = $os.ProductName; | |
"Version Number" = $os.CurrentVersion | |
}; | |
View Check-InstanceConfig.ps1
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
#region Links | |
<# | |
NOTE: Links are subject to change by Microsoft | |
Server Configuration Options BOL: | |
SQL Server 2014 - http://technet.microsoft.com/en-us/library/ms189631(v=sql.120).aspx | |
SQL Server 2012 - http://technet.microsoft.com/en-us/library/ms189631(v=sql.110).aspx | |
SQL Server 2008 R2 - http://technet.microsoft.com/en-us/library/ms189631(v=sql.105).aspx | |
SQL Server 2008 - http://technet.microsoft.com/en-us/library/ms189631(v=sql.100).aspx | |
SQL Server 2005 - http://technet.microsoft.com/en-us/library/ms189631(v=sql.90).aspx | |
SQL Server 2000 - http://technet.microsoft.com/en-us/library/aa196706(v=sql.80).aspx |
View Code_dbatools_settings.json
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
//playing with color settings | |
"workbench.colorCustomizations": { | |
"activityBar.background": "#F0EBD7", | |
"activityBar.foreground": "#C9A735", | |
"activityBarBadge.foreground": "#3F3C3D", | |
"activityBarBadge.background": "#FFFFFF", | |
"panel.background": "#F3F7F2", | |
"statusBar.background": "#BFB297", | |
"statusBar.foreground": "#FFFFFF", | |
"sideBar.background": "#383636", |
View Out-CodeView.ps1
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
<# | |
.SYNOPISIS | |
Generate an HTML view that will open in an editor for VS Code | |
.NOTES | |
Add this to your Microsoft.VSCode_profile.ps1 file | |
.EXAMPLE | |
$results = Get-DbaSpConfigure -SqlInstance manatarms | |
Out-CodeView $results | |
#> | |
function Out-CodeView { |
View Get-MyEc2Instance
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
param( | |
[string]$OwnerValue = 'melton', | |
[switch]$Raw | |
) | |
$myEc2Instances = Get-EC2Tag -Filter @{ Name="key"; Values="owner" },@{ Name="value";Values=$OwnerValue}, @{ Name="resource-type";Values="instance"} | |
$data = Get-EC2Instance -InstanceId $myEc2Instances.ResourceId | Select-Object -ExpandProperty Instances | |
if ($Raw) { | |
foreach ($d in $data) { | |
$value = ($d.Tags | Where-Object Key -eq Name).Value |
View sql.json
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
{ | |
"New SQL Login": { | |
"prefix": "new-sql-login", | |
"body": [ | |
"CREATE LOGIN [${1:name of the login}] WITH PASSWORD = N'${2:password value}', CHECK_EXPIRATION = OFF, CHECK_POLICY = OFF;", | |
], | |
"description": "Create a new SQL Login" | |
}, | |
"New Windows Login": { | |
"prefix": "new-windows-login", |
View backup-history.sql
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; | |
SELECT distinct t1.name AS 'DatabaseName' | |
,(datediff( ss, t3.backup_start_date, t3.backup_finish_date)) AS 'DurationInSeconds' | |
,t3.user_name AS 'UserResponsible' | |
,t3.name AS backup_name | |
,t3.description | |
,t3.backup_start_date | |
,t3.backup_finish_date | |
,CASE |
View keybinds.json
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
// Place your key bindings in this file to overwrite the defaults | |
[ | |
{ | |
"key": "alt+up", | |
"command": "workbench.action.navigateUp" | |
}, | |
{ | |
"key": "alt+down", | |
"command": "workbench.action.navigateDown" | |
}, |
View PBM-Test-Policy-Condition.sql
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
/* All Conditions */ | |
DECLARE @condition_id INT | |
EXEC msdb.dbo.sp_syspolicy_add_condition | |
@name=N'AutoShrink', | |
@description=N'Verify AutoShrink is disabled', | |
@facet=N'Database', | |
@expression=N'<Operator> | |
<TypeClass>Bool</TypeClass> | |
<OpType>EQ</OpType> | |
<Count>2</Count> |
OlderNewer