ListShortcuts.csx

sample output

Read More

Launch .CSX as conveniently as .BAT files

first, get Chocolatety if you don’t already have… killer handy

then make sure you have a .csx runner… either ScriptCS or csi.exe starting with Visual Studio 2015 update 3

setup the .csx to runner file association

%~2 means all args starting with #2… see ftype docs for more FYI for TCC LE […]

Read More

Bash script – loop over inline list of files

Read More

SED – Insert text after match

General syntax: sed “s/search-for-regex/& replace-with/” filename.txt Example: sed “s/BEGIN AS/& nnSET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED/” Plans_s.sql Explanation: s/search-for-regex/replace-with/ = search and replace command & = the matched text (effectively leaves the matched text alone rather than “replacing” it) n = carriage return

Read More

SQL Split AWK Script

Split the output from SQL Server Management Studio (SSMS) > View > Object Explorer Details > “Script {function|view|procedure} as” into individual files Note: The current RegEx’s are tailored around the following scripting options (see comments to change): “Include descriptive headers” = true  (this is the default after SSMS 2008 install) – located under:  SSMS > […]

Read More