This file contains hidden or 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
{"title":"Martin Fowler","link":"https://martinfowler.com/feed.atom","items":[{"title":"My favorite musical discoveries of 2022","description":{"_":"\n<div class = 'img-link'><a href = 'https://martinfowler.com/articles/2022-music.html'><img src = 'https://martinfowler.com/articles/2022-music/card.png' width = ''></img></a></div>\n\n<p>I continue my habit of picking out <a href = 'https://martinfowler.com/articles/2022-music.html'>six favorite musical discoveries</a> for\n last year. 2022 includes big-band techno, Mediterranean fusion,\n afrobeat in England, jazz-folk vocals, and accordion-led jazz trio.</p>\n\n<p><a class = 'more' href = 'https://martinfowler.com/articles/2022-music.html'>more…</a></p>","$":{"type":"html"}},"entryDate":"2023-01-12T08:50:00-05:00","link":"https://martinfowler.com/articles/2022-music.html"},{"title":"Some activities for the Data Mesh Accelerate Workshop","description":{"_":"\n<div class = 'img-link'><a href = 'https://martinfowler.com/articles/data-mesh-accelerate-work |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Interactivity; | |
namespace myapp.Views |
This file contains hidden or 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
-- Change this to 1 to also run on system databases. | |
DECLARE @UseSystem bit = 0 | |
-- Change this line for the script to run. | |
DECLARE @SQL NVARCHAR(MAX) = 'SELECT DB_NAME() AS DBName, COUNT(*) AS TableCount FROM sys.tables' | |
DECLARE @DBName NVARCHAR(255) | |
DECLARE csrData CURSOR FOR | |
SELECT name | |
FROM sys.databases | |
WHERE ((@UseSystem = 1) OR name NOT IN ('master', 'tempdb', 'model', 'msdb')) |
This file contains hidden or 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
-- Table for which to find foreign keys | |
DECLARE @TableName NVARCHAR(255) = 'MyTable' | |
-- Select foreign keys and delete statements to remove references. Also get a select. | |
-- Generated statements only work for tables with single column foreign keys. | |
SELECT | |
'DELETE FROM ' + pt.name + ' WHERE ' + pc.name + ' NOT IN (' + | |
'SELECT ' + rc.name + ' FROM ' + rt.name + ');' AS del, | |
'SELECT ' + pc.name + ' FROM ' + pt.name + ' WHERE ' + pc.name + ' NOT IN (' + | |
'SELECT ' + rc.name + ' FROM ' + rt.name + ');' AS sel, |
This file contains hidden or 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
SELECT CASE WHEN sys.databases.name IS NULL THEN '--TOTAL--' ELSE sys.databases.name END AS DBName, | |
CAST(SUM(size)*8.0/1024.0 AS INT) AS SizeMB | |
FROM sys.databases JOIN sys.master_files ON sys.databases.database_id = sys.master_files.database_id | |
GROUP BY sys.databases.name WITH ROLLUP | |
ORDER BY SizeMB DESC |
This file contains hidden or 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
DECLARE @sql NVARCHAR(MAX) | |
DECLARE @RowCounts AS TABLE (name NVARCHAR(MAX), RowCnt int) | |
DECLARE csrData CURSOR FAST_FORWARD FOR | |
SELECT | |
'SELECT ''[' + schema_name(schema_id) + '].[' + name + ']'', COUNT(*) AS RowCnt FROM [' + schema_name(schema_id) + '].[' + + name + '] (NOLOCK)' | |
FROM sys.tables | |
OPEN csrData |
This file contains hidden or 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 #tempHAL ( | |
SPID NVARCHAR(255), | |
Status NVARCHAR(255), | |
Login NVARCHAR(255), | |
HostName NVARCHAR(255), | |
BlkBy NVARCHAR(255), | |
DBName NVARCHAR(255), | |
Command NVARCHAR(MAX), | |
CPUTime NVARCHAR(255), | |
DiskIO NVARCHAR(255), |
This file contains hidden or 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
-- This will generate Microsoft TSQL (MS SQL Server) in order to merge table records given a specific single-column key. | |
SET NOCOUNT ON | |
DECLARE @UseTempTable bit = 0 | |
DECLARE @ColumnList NVARCHAR(MAX); | |
DECLARE @SColumnList NVARCHAR(MAX); | |
DECLARE @SetColumnList NVARCHAR(MAX); | |
DECLARE @SelectValueList NVARCHAR(MAX); |
This file contains hidden or 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]$LeftFolder, | |
[string]$RightFolder | |
) | |
function CreateFolderStructure([string]$Path) | |
{ | |
if (-not [string]::IsNullOrWhiteSpace($Path)) | |
{ | |
if (-not (Test-Path $Path)) |
This file contains hidden or 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
' This function uses HTMLAgilityPack, available from NuGet. | |
' You must COM Register HTMLAgilityPack and reference it from your Excel macros. | |
' This is not a proper implementation, but should work in general. | |
Public Function StripHTML(html As Object, Optional NL As Boolean = False, Optional LI As Boolean = False) As String | |
Dim HDoc As HtmlAgilityPack.HtmlDocument | |
Dim ret As String | |
Dim htmlStr As String | |