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 => |
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
public static class SqlConnectionStringValidator | |
{ | |
public enum ErrorReason { None, ServerNetwork, Database, UserPassword, Other } | |
public static bool TryValidateConnectionString(string server, string database, string user, string password, out string connectionString, out ErrorReason reason, out string message) | |
{ | |
connectionString = default; | |
if (!TryValidateValues(server, database, user, password, out reason, out message)) | |
{ |
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 @JsonOutput NVARCHAR(MAX); | |
WITH TablesToExclude AS | |
( | |
SELECT fk.parent_object_id AS object_id | |
FROM sys.foreign_keys AS fk | |
GROUP BY fk.parent_object_id | |
HAVING COUNT(fk.object_id) = 2 | |
UNION |
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
BEGIN TRANSACTION | |
GO | |
CREATE PROCEDURE FetchObjectsWithMetadata | |
@SortBy NVARCHAR(50), | |
@PageSize INT = 10, | |
@PageNumber INT, | |
@NameFilter NVARCHAR(256) | |
AS | |
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
begin transaction; | |
create table Location | |
( | |
Id int primary key, | |
City varchar(255), | |
[State] char(2), | |
Zip char(5) unique, | |
); |
NewerOlder