Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@datahai
datahai / NewFactSalesView.sql
Created July 29, 2021 18:30
New Fact Sales View
DROP VIEW LDW.vwFactSales;
GO
CREATE VIEW LDW.vwFactSales
AS
SELECT *,
CAST(fct.filepath(3) AS DATE) AS SalesOrderPathDate
FROM
OPENROWSET
(
@datahai
datahai / TriggerEventsSnippet.cs
Last active July 29, 2021 18:25
Trigger Azure Event Hub
//create the message structure
WebVisitMessage webvisitmessage = new WebVisitMessage
{
SessionID = SessionID,
EventType = "visitwebsite",
EventDateTime = dateincrement,
URL = URL,
Device = device
};
SELECT DATALENGTH(20120101),
DATALENGTH(CAST(20120101 AS INT))