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
Premise | |
A premise is an idea or theory on which a statement or action is based. For example, in the argument “All humans are mortal; Socrates is human; therefore, Socrates is mortal”, the first two statements are premises and the last one is the conclusion. Premise can also be used as a verb, meaning to base a theory, argument, etc. on an idea, thought, or belief. For example, “He premised his argument on several incorrect assumptions”. | |
[source Microsoft Copilot "define Premise" Feb 2024] | |
Premises | |
Premises is a plural noun that means the land and buildings owned by someone, especially by a company or organization. It can also mean the land and buildings on which something is done or used, such as a business, a school, or a restaurant. For example, “The company is relocating to new premises” or “There is no smoking allowed anywhere on school premises” | |
[source Microsoft Copilot "define Premises" Feb 2024] |
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
function Format-QuotedString { | |
<# | |
.SYNOPSIS | |
Wraps a string in delimiters | |
.DESCRIPTION | |
Takes in a string, returns the same string wrapped in chosen delimiters. Made to fill a similar role as the TSQL QUOTENAME function. | |
.PARAMETER String | |
The string you want wrapped |
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 $Source to be the path to the xlsx to process | |
#requires -module ImportExcel | |
# cleans Excel column headers from having leading / trailing spaces and replaces other spaces with underscore '_' | |
# and then uses this set of headers to import data from the xlsx with headers that are easier to handle in code. | |
# Essentially lines 8-14 are extra to a normal use of Import-Excel and the import line uses the header info and -StartRow to skip the file headers | |
# the target xlsx remains unchanged | |
$h = Import-Excel $source -StartRow 1 -EndRow 2 | |
$headers = ($h | Get-Member -MemberType Properties | ForEach-Object { |
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
function New-QuotedString { | |
<# | |
.SYNOPSIS | |
Takes a pasted set of cells from Excel and returns a quoted, comma separated string that can be pasted into SSMS for a SQL filter | |
.DESCRIPTION | |
Long description | |
.PARAMETER ItemsList |
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
$scrpt1 = { | |
if(!(test-connection 'localhost' -Count 1 -Quiet)){return} | |
else{0..7 | % { "'"+(get-date).AddDays($_)+"'" }} | |
} | |
$scrpt2 = { | |
if((get-date).minute % 2 -eq 0){ | |
@('Mon','Wed','Fri')} | |
else{ | |
@('Tue','Thu','Sat') | |
} |
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
<# | |
Assumptions | |
$splatExcel is a hash table used for splatting the data into the Excel file with Export-Excel. Path is the path for the file. | |
The Excel file has a worksheet with the name of _BatchLoadData_ which has a single table named _BatchLoadDataTable_ in it | |
The data table has many columns that include _JobID_ and _Batch_ | |
Result | |
A worksheet is added to the workbook called _BatchLoadPvt_ which contains the pivot table that we describe |
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
/* | |
To visualise the hierarchy of SQL Server Audit Events and their parent groups | |
I think this was originally on the Microsoft official SQL Server Books online and it possibly still is. I can however never | |
find it when I need it so I have taken an adjusted version and pasted it here for easy access. | |
Thanks to unknown Microsoft employee that got their head around the CTE and Event relationships logic to come up with this. | |
*/ | |
WITH datas (EventLevel, EventParent, EventName, EventType) |
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
<# | |
Zips a set of files into a set of zip files with a max size to allow emailing of zip files in size-restricted email environment. | |
Imagine 20 evenly sized files that need to be zipped and when compressed into a single .zip file, the file is 65MB. With an Exchange | |
email size limit of 15MB this cannot be sent by email. Using this function you can set a ZipSize limit of 12MB and then the output | |
will be 5 .zip files with a size around 12MB and one of around 5MB. | |
No source file will be spanned across zip files so the actual balance of zip file sizes will vary. | |
#> |
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
git branch -m master main | |
git checkout main | |
git push -u origin main | |
now go to github.com and change the default branch ot main | |
created with reference to https://www.hanselman.com/blog/EasilyRenameYourGitDefaultBranchFromMasterToMain.aspx |
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
===== | |
For VSCode extension replacerules <https://marketplace.visualstudio.com/items?itemName=bhughes339.replacerules> | |
This needs to be placed in the settings.json file | |
dont forget to add a trailing comma to the content that you find there | |
and also close the final curly brace correctly | |
===== | |
"replacerules.rules": { | |
"Format sp_diagnostics results 01": { | |
"find": "><", |
NewerOlder