Converted into a module: https://github.com/tcartwright/EnterDeveloperPowerShell
PS Gallery link: https://www.powershellgallery.com/packages/EnterDeveloperPowerShell/
Converted into a module: https://github.com/tcartwright/EnterDeveloperPowerShell
PS Gallery link: https://www.powershellgallery.com/packages/EnterDeveloperPowerShell/
Converted into a module: https://github.com/tcartwright/tcdbtools
PS Gallery link: https://www.powershellgallery.com/packages/tcdbtools/
/* | |
Tim C: This query can be used as a normal query, or it can also be used to import into an OUTLOOK calendar so | |
you can visualize your backups. Similar to https://dbatools.io/timeline/ | |
RECOMMENDATIONS: | |
1) You should import into a CUSTOM blank excel calendar | |
2) You should not import TLOG backups, as that will utterly bloat the calendar | |
****************************************************************************************** | |
TO CREATE A NEW CALENDAR: |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[string] $path | |
) | |
Clear-Host | |
[xml]$plan = Get-Content -Path ($path.TrimStart('"').TrimEnd('"')) |
[CmdletBinding()] | |
Param ( | |
[Parameter(Mandatory=$true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[string] $ServerInstance, | |
[Parameter(Mandatory=$true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] | |
[string] $planHandle | |
) | |
<# |
/* | |
TIM C: Generates 4 backup job scripts for ola hallengren backups. Splits the databases as evenly by size as it can. The options for the job can be changed below. | |
Alternative to using "DatabasesInParallel = true" with "DatabaseOrder = DATABASE_NAME_DESC" https://ola.hallengren.com/sql-server-backup.html | |
Allows for manual editing of database order and job distribution. The output of each script can be set up as a seperate job. | |
TO DO: automate - job creation and job update. | |
*/ | |
-- CHANGE ME |
function GetByteString([Byte[]]$bytes) { | |
#TIM C: I am not sure this is the proper way to do this, but it seems to work in all the test cases I throw at it. | |
$byteStr = [System.BitConverter]::ToString($bytes).Replace("-", "") | |
return "0x$byteStr"; | |
} | |
function GetColumnValueFormat ([string] $DataType, [string] $ColumnName, [switch]$ReplaceDollarSignsInValues = $false) { | |
#TIM C: constructing the proper format of these is a PITA. Its best to copy the result into a another powershell window to check the syntax | |
$value = "`$(switch(`$reader.IsDBNull(`$reader.GetOrdinal(`"$ColumnName`"))){`$true{`"NULL`"}`$false{%%FALSE_PART%%}})"; | |
#`$reader.GetValue(`$reader.GetOrdinal(`"$ColumnName`")) |
<# | |
.Synopsis | |
Tests the connectivity between two computers on a TCP Port | |
.Description | |
The Telnet command tests the connectivity between two computers on a TCP Port. By running this command, you can determine if specific service is running on Server. | |
.Parameter <ComputerName> | |
This is a required parameter where you need to specify a computer name which can be localhost or a remote computer |
SET ANSI_NULLS ON | |
GO | |
SET QUOTED_IDENTIFIER ON | |
GO | |
IF OBJECT_ID('dbo.SetContextInfo') IS NOT NULL BEGIN | |
DROP PROCEDURE [dbo].[SetContextInfo] | |
END | |
GO | |
/*============================================= |