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
| ------------------------------------------------------------ | |
| -- Temporal Tables demo (idempotent, all in one script) | |
| -- Uses unique table names to avoid conflicts with other demos | |
| ------------------------------------------------------------ | |
| ------------------------------------------------------------ | |
| -- Reset (safe to rerun) | |
| ------------------------------------------------------------ | |
| IF OBJECT_ID('dbo.TodosTemporal', 'U') IS NOT NULL | |
| BEGIN |
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
| ------------------------------------------------------------ | |
| -- Dynamic Data Masking demo (SSN, Email, Phone) | |
| -- Idempotent all-in-one script | |
| ------------------------------------------------------------ | |
| ------------------------------------------------------------ | |
| -- Step 1: Create user | |
| ------------------------------------------------------------ | |
| IF NOT EXISTS (SELECT 1 FROM sys.database_principals WHERE name = 'AppUser') | |
| BEGIN |
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
| ------------------------------------------------------------ | |
| -- Enable Soft Delete in Azure SQL using Row-Level Security | |
| -- Fully idempotent, correct dependency ordering | |
| ------------------------------------------------------------ | |
| ------------------------------------------------------------ | |
| -- Step 1: Create database, login, and user | |
| ------------------------------------------------------------ | |
| USE master; | |
| GO |
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
| DROP USER IF EXISTS PeopleReader; | |
| DROP TABLE IF EXISTS People; | |
| CREATE TABLE People | |
| ( | |
| Id INT PRIMARY KEY, | |
| Name VARCHAR(100), | |
| SSN VARCHAR(11) MASKED WITH | |
| (FUNCTION = 'partial(0,"XXX-XX-",4)') | |
| ); |
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.Text.Json; | |
| using Health; | |
| using Microsoft.AspNetCore.Diagnostics.HealthChecks; | |
| using Microsoft.Extensions.Diagnostics.HealthChecks; | |
| using System.Diagnostics; | |
| internal class Program | |
| { | |
| private static void Main(string[] args) | |
| { |
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 dbo.STATE ( | |
| ID INT PRIMARY KEY, | |
| Name NVARCHAR(50), | |
| Description NVARCHAR(255) | |
| ); | |
| EXEC sp_addextendedproperty | |
| @name = N'MS_Description', | |
| @value = N'Table holding state information', | |
| @level0type = N'user', @level0name = dbo, |
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.Drawing; | |
| public class Program | |
| { | |
| static Program() | |
| { | |
| Console.Clear(); | |
| Console.CursorVisible = false; | |
| } | |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 FUNCTION dbo.GetTicTacToeWinner( | |
| @Cell1 CHAR(1), | |
| @Cell2 CHAR(1), | |
| @Cell3 CHAR(1), | |
| @Cell4 CHAR(1), | |
| @Cell5 CHAR(1), | |
| @Cell6 CHAR(1), | |
| @Cell7 CHAR(1), | |
| @Cell8 CHAR(1), | |
| @Cell9 CHAR(1) |
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 OpenTelemetry.Metrics; | |
| using OpenTelemetry.Trace; | |
| using System.Diagnostics; | |
| using System.Diagnostics.Metrics; | |
| var builder = WebApplication.CreateBuilder(args); | |
| builder.Services.AddScoped<EndpointMeters>(); | |
| builder.Services.AddOpenTelemetry() | |
| .WithMetrics(options => |
NewerOlder